Ticket #1613: BetterPatch.patch

File BetterPatch.patch, 38.7 KB (added by wraitii, 9 years ago)
  • binaries/data/mods/public/art/materials/objectcolor.xml

     
    22<material>
    33    <shader effect="model"/>
    44    <define name="USE_OBJECTCOLOR" value="1"/>
     5   
     6    <required_texture name="baseTex"/>
    57</material>
  • binaries/data/mods/public/art/materials/player_trans_parallax.xml

     
    77    <conditional_define name="USE_PARALLAX_MAP" value="1" type="draw_range" conf="PARALLAX_DIST"/>
    88    <conditional_define name="USE_HQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_HQ_DIST"/>
    99    <conditional_define name="USE_VHQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_VHQ_DIST"/>
    10     <define name="USE_NORMAL_MAP" value="1"/>
    1110
    1211    <!--<define name="USE_SPECULAR_MAP" value="1"/>
    1312    <define name="USE_SELF_LIGHT" value="1"/>-->
     
    2019     Third value: Parallax scale.
    2120     Fourth value: AO amount. -->
    2221    <uniform name="effectSettings" value="1.0 50.0 0.0075 0.75"/>
     22   
     23    <required_texture name="baseTex"/>
     24    <required_texture name="normTex" define="USE_NORMAL_MAP"/>
     25
    2326</material>
  • binaries/data/mods/public/art/materials/player_trans.xml

     
    22<material>
    33    <shader effect="model"/>
    44    <define name="USE_PLAYERCOLOR" value="1"/>
     5    <required_texture name="baseTex"/>
    56</material>
  • binaries/data/mods/public/art/materials/trans_wind_parallax_spec.xml

     
    66    <conditional_define name="USE_PARALLAX_MAP" value="1" type="draw_range" conf="PARALLAX_DIST"/>
    77    <conditional_define name="USE_HQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_HQ_DIST"/>
    88    <conditional_define name="USE_VHQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_VHQ_DIST"/>
    9     <define name="USE_NORMAL_MAP" value="1"/>
    10     <define name="USE_SPECULAR_MAP" value="1"/>
    119    <uniform name="effectSettings" value="1.0 50.0 0.0075 0.85"/>
    1210   
    1311    <renderquery name="sim_time"/>
    1412    <define name="USE_WIND" value="1"/>
    1513    <uniform name="windData" value="1.0 1.0"/>
     14
     15    <required_texture name="baseTex"/>
     16    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
     17    <required_texture name="normTex" define="USE_NORMAL_MAP"/>
    1618</material>
  • binaries/data/mods/public/art/materials/terrain_norm.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<material>
    33    <shader effect="terrain_base"/>
    4     <define name="USE_NORMAL_MAP" value="1"/>
    54   
    65    <uniform name="effectSettings" value="1.0 15.0 0.0 0.0"/>
     6    <required_texture name="normTex" define="USE_NORMAL_MAP"/>
    77</material>
  • binaries/data/mods/public/art/materials/trans_wind.xml

     
    44    <renderquery name="sim_time"/>
    55    <define name="USE_WIND" value="1"/>
    66    <uniform name="windData" value="1.0 1.0"/>
     7    <required_texture name="baseTex"/>
    78</material>
  • binaries/data/mods/public/art/materials/player_trans_spec.xml

     
    33    <shader effect="model"/>
    44    <alternative material="player_trans.xml" quality="1"/>
    55    <define name="USE_PLAYERCOLOR" value="1"/>
    6     <define name="USE_SPECULAR_MAP" value="1"/>
    76    <!-- <define name="USE_SELF_LIGHT" value="1"/> -->
    87
    98    <!-- Settings for effects above:
     
    1211     Third value: Parallax scale.
    1312     Fourth value: AO amount. -->
    1413    <uniform name="effectSettings" value="1.0 50.0 0.0075 0.85"/>
     14   
     15    <required_texture name="baseTex"/>
     16    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
     17
    1518</material>
  • binaries/data/mods/public/art/materials/player_water.xml

     
    1313    <uniform name="murkiness" value="0.6"/>
    1414    <uniform name="reflectionTint" value="0.3 0.4 0.3"/>
    1515    <uniform name="reflectionTintStrength" value="0.1"/>
     16    <required_texture name="baseTex"/>
    1617</material>
  • binaries/data/mods/public/art/materials/terrain_base.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<material>
    33    <shader effect="terrain_base"/>
     4    <required_texture name="baseTex"/>
    45</material>
  • binaries/data/mods/public/art/materials/basic_trans.xml

     
    44    <alpha_blending/>
    55    <define name="USE_TRANSPARENT" value="1"/>
    66    <alternative material="alphatest.xml" if="CFG_FORCE_ALPHATEST"/>
     7   
     8    <required_texture name="baseTex"/>
    79</material>
  • binaries/data/mods/public/art/materials/basic_trans_ao_spec.xml

     
    1111    <conditional_define name="USE_VHQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_VHQ_DIST"/>
    1212    <define name="USE_NORMAL_MAP" value="1"/>-->
    1313
    14     <define name="USE_SPECULAR_MAP" value="1"/>
    1514    <!-- <define name="USE_SELF_LIGHT" value="1"/> -->
    1615
    17     <define name="USE_AO" value="1"/>
    1816
    1917    <!-- Settings for effects above:
    2018     First value: Normal mapping intensity.
     
    2220     Third value: Parallax scale.
    2321     Fourth value: AO amount. -->
    2422    <uniform name="effectSettings" value="1.0 50.0 0.0075 0.85"/>
     23   
     24    <required_texture name="baseTex"/>
     25    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
     26    <required_texture name="aoTex" define="USE_AO"/>
    2527</material>
  • binaries/data/mods/public/art/materials/basic_trans_spec.xml

     
    1111    <conditional_define name="USE_VHQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_VHQ_DIST"/>
    1212    <define name="USE_NORMAL_MAP" value="1"/>-->
    1313
    14     <define name="USE_SPECULAR_MAP" value="1"/>
    1514    <!-- <define name="USE_SELF_LIGHT" value="1"/> -->
    1615
    1716    <!-- Settings for effects above:
     
    2019     Third value: Parallax scale.
    2120     Fourth value: AO amount. -->
    2221    <uniform name="effectSettings" value="1.0 50.0 0.0075 0.85"/>
     22   
     23    <required_texture name="baseTex"/>
     24    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
     25    <required_texture name="normTex" define="USE_NORMAL_MAP"/>
     26
    2327</material>
  • binaries/data/mods/public/art/materials/objectcolor_specmap.xml

     
    44
    55    <define name="USE_OBJECTCOLOR" value="1"/>
    66
    7     <define name="USE_SPECULAR_MAP" value="1"/>
    87    <uniform name="effectSettings" value="1.0 50.0 0.0075 0.85"/>
     8   
     9    <required_texture name="baseTex"/>
     10    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
    911</material>
  • binaries/data/mods/public/art/materials/objectcolor_spec.xml

     
    77    <define name="USE_SPECULAR" value="1"/>
    88    <uniform name="specularPower" value="16.0"/>
    99    <uniform name="specularColor" value="1.0 1.0 1.0"/>
     10
     11<required_texture name="baseTex"/>
    1012</material>
  • binaries/data/mods/public/art/materials/basic_glow.xml

     
    55    <define name="USE_TRANSPARENT" value="1"/> 
    66    <alternative material="basic_trans.xml" quality="2"/>
    77    <alternative material="alphatest_ao_parallax_spec.xml" if="CFG_FORCE_ALPHATEST"/>
    8     <define name="USE_SPECULAR_MAP" value="1"/>
    98    <define name="USE_SELF_LIGHT" value="1"/>
    109    <uniform name="effectSettings" value="1.0 50.0 0.0075 0.85"/>
     10    <required_texture name="baseTex"/>
     11    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
    1112</material>
  • binaries/data/mods/public/art/materials/terrain_norm_spec.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<material>
    33    <shader effect="terrain_base"/>
    4     <define name="USE_NORMAL_MAP" value="1"/>
    5     <define name="USE_SPECULAR_MAP" value="1"/>
    64   
    75    <uniform name="effectSettings" value="1.0 15.0 0.0 0.0"/>
     6    <required_texture name="baseTex"/>
     7    <required_texture name="normTex" define="USE_NORMAL_MAP"/>
     8    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
    89</material>
  • binaries/data/mods/public/art/materials/aura.xml

     
    44    <alpha_blending/>
    55    <renderquery name="sim_time"/>
    66    <uniform name="translation" value="0.0 -0.1"/>
    7     <define name="USE_SPECULAR_MAP" value="1"/>
    87    <define name="USE_SELF_LIGHT" value="1"/>
    98    <uniform name="specularPower" value="100.0"/>
    109    <uniform name="specularColor" value="1.0 1.0 1.0"/>
     10    <required_texture name="baseTex"/>
     11    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
    1112</material>
  • binaries/data/mods/public/art/materials/player_trans_ao.xml

     
    1212    <!--<define name="USE_SPECULAR_MAP" value="1"/>
    1313    <define name="USE_SELF_LIGHT" value="1"/>-->
    1414
    15     <define name="USE_AO" value="1"/>
    1615   
    1716    <!-- Settings for effects above:
    1817         First value: Normal mapping intensity.
     
    2019     Third value: Parallax scale.
    2120     Fourth value: AO amount. -->
    2221    <uniform name="effectSettings" value="1.0 50.0 0.0075 0.6"/>
     22   
     23    <required_texture name="baseTex"/>
     24    <required_texture name="aoTex" define="USE_AO"/>
     25
    2326</material>
  • binaries/data/mods/public/art/materials/basic_spec.xml

     
    55    <define name="USE_SPECULAR" value="1"/>
    66    <uniform name="specularPower" value="16.0"/>
    77    <uniform name="specularColor" value="1.0 1.0 1.0"/>
     8   
     9    <required_texture name="baseTex"/>
    810</material>
  • binaries/data/mods/public/art/materials/no_trans_parallax_ao.xml

     
    66    <conditional_define name="USE_PARALLAX_MAP" value="1" type="draw_range" conf="PARALLAX_DIST"/>
    77    <conditional_define name="USE_HQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_HQ_DIST"/>
    88    <conditional_define name="USE_VHQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_VHQ_DIST"/>
    9     <define name="USE_NORMAL_MAP" value="1"/>
    109
    1110    <!-- <define name="USE_SELF_LIGHT" value="1"/> -->
    1211
    13     <define name="USE_AO" value="1"/>
    1412
    1513    <!-- Settings for effects above:
    1614         First value: Normal mapping intensity.
     
    1816     Third value: Parallax scale.
    1917     Fourth value: AO amount. -->
    2018    <uniform name="effectSettings" value="1.0 50.0 0.0075 0.85"/>
     19    <required_texture name="baseTex"/>
     20    <required_texture name="normTex" define="USE_NORMAL_MAP"/>
     21    <required_texture name="aoTex" define="USE_AO"/>
     22
    2123</material>
  • binaries/data/mods/public/art/materials/alphatest_ao_parallax_spec.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<material>
     3    <required_texture name="baseTex"/>
     4
    35    <shader effect="model_transparent"/>
    46    <define name="USE_TRANSPARENT" value="1"/>
    57    <define name="USE_ALPHATEST" value="1"/>
    68   
     9    <required_texture name="baseTex"/>
    710    <!--define name="USE_PLAYERCOLOR" value="1"/-->
    811   
    912    <!-- REQUIRES: Actor must provide a texture named "normTex", where the Alpha channel
  • binaries/data/mods/public/art/materials/waterfall.xml

     
    77   
    88    <uniform name="specularPower" value="16.0"/>
    99    <uniform name="specularColor" value="1.0 1.0 1.0"/>
     10
     11    <required_texture name="baseTex"/>
    1012</material>
  • binaries/data/mods/public/art/materials/rock_bump_spec_test.xml

     
    1616    <!-- REQUIRES: Actor must provide a texture named "normTex", where the RGB channels
    1717           are a normal map corresponding to XYZ normals.
    1818     EFFICIENCY: This is a relatively inexpensive effect that should run easily on most hardware. -->
    19     <define name="USE_NORMAL_MAP" value="1"/>
    2019   
    2120    <!-- REQUIRES: Actor must provide a texture named "specTex", where the RGB channels
    2221           provide a specular colour multiplier.
     
    2625          no specularity.
    2726     COMPATIBILITY: This effect is incompatible with the old "USE_SPECULAR" effect.
    2827     EFFICIENCY: This is a relatively inexpensive effect that should run easily on most hardware. -->
    29     <define name="USE_SPECULAR_MAP" value="1"/>
    3028   
    3129    <!-- REQUIRES: That "USE_SPECULAR_MAP" is enabled and a texture named "specTex" is provided by the Actor.
    3230           The Alpha channel of the texture defines the amount of self-illumination, with
     
    4644     Third value: Parallax scale.
    4745     Fourth value: AO amount. -->
    4846    <uniform name="effectSettings" value="5.0 50.0 0.0075 0.85"/>
     47   
     48    <required_texture name="baseTex"/>
     49    <required_texture name="normTex" define="USE_NORMAL_MAP"/>
     50    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
    4951</material>
  • binaries/data/mods/public/art/materials/playercolor_spec.xml

     
    77    <define name="USE_SPECULAR" value="1"/>
    88    <uniform name="specularPower" value="16.0"/>
    99    <uniform name="specularColor" value="1.0 1.0 1.0"/>
     10    <required_texture name="baseTex"/>
    1011</material>
  • binaries/data/mods/public/art/materials/blend_spec.xml

     
    99    <define name="USE_SPECULAR" value="1"/>
    1010    <uniform name="specularPower" value="16.0"/>
    1111    <uniform name="specularColor" value="1.0 1.0 1.0"/>
     12    <required_texture name="baseTex"/>
    1213</material>
  • binaries/data/mods/public/art/materials/basic_trans_parallax_spec.xml

     
    99    <conditional_define name="USE_PARALLAX_MAP" value="1" type="draw_range" conf="PARALLAX_DIST"/>
    1010    <conditional_define name="USE_HQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_HQ_DIST"/>
    1111    <conditional_define name="USE_VHQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_VHQ_DIST"/>
    12     <define name="USE_NORMAL_MAP" value="1"/>
    1312
    14     <define name="USE_SPECULAR_MAP" value="1"/>
    1513    <!-- <define name="USE_SELF_LIGHT" value="1"/> -->
    1614
    1715    <!--<define name="USE_AO" value="1"/>-->
     
    2220     Third value: Parallax scale.
    2321     Fourth value: AO amount. -->
    2422    <uniform name="effectSettings" value="1.0 50.0 0.0075 0.85"/>
     23    <required_texture name="baseTex"/>
     24    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
     25    <required_texture name="normTex" define="USE_NORMAL_MAP"/>
    2526</material>
  • binaries/data/mods/public/art/materials/alphatest_spec.xml

     
    77    <define name="USE_SPECULAR" value="1"/>
    88    <uniform name="specularPower" value="16.0"/>
    99    <uniform name="specularColor" value="1.0 1.0 1.0"/>
     10    <required_texture name="baseTex"/>
    1011</material>
  • binaries/data/mods/public/art/materials/material.rnc

     
    3939    element renderquery {
    4040        attribute name { text }
    4141    }*
     42    element required_texture {
     43        attribute name { text }
     44    }*
    4245}
  • binaries/data/mods/public/art/materials/basic_trans_ao_parallax_spec.xml

     
    99    <conditional_define name="USE_PARALLAX_MAP" value="1" type="draw_range" conf="PARALLAX_DIST"/>
    1010    <conditional_define name="USE_HQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_HQ_DIST"/>
    1111    <conditional_define name="USE_VHQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_VHQ_DIST"/>
    12     <define name="USE_NORMAL_MAP" value="1"/>
    1312
    14     <define name="USE_SPECULAR_MAP" value="1"/>
    1513    <!-- <define name="USE_SELF_LIGHT" value="1"/> -->
    1614
    17     <define name="USE_AO" value="1"/>
    1815   
    1916    <!-- Settings for effects above:
    2017         First value: Normal mapping intensity.
     
    2219     Third value: Parallax scale.
    2320     Fourth value: AO amount. -->
    2421    <uniform name="effectSettings" value="1.0 50.0 0.0075 0.85"/>
     22   
     23    <required_texture name="baseTex"/>
     24    <required_texture name="normTex" define="USE_NORMAL_MAP"/>
     25    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
     26    <required_texture name="aoTex" define="USE_AO"/>
    2527</material>
  • binaries/data/mods/public/art/materials/terrain_grass.xml

     
    55    <!--define name="USE_SPECULAR_MAP" value="1"/-->
    66   
    77    <!--uniform name="specularPower" value="15.0"/-->
     8    <required_texture name="baseTex"/>
    89</material>
  • binaries/data/mods/public/art/materials/material.rng

     
    8686        <attribute name="name"/>
    8787      </element>
    8888    </zeroOrMore>
     89    <zeroOrMore>
     90        <element name="required_texture">
     91            <attribute name="name"/>
     92        </element>
     93    </zeroOrMore>
    8994  </interleave>
    9095</element>
  • binaries/data/mods/public/art/materials/basic_trans_ao.xml

     
    1414    <!--<define name="USE_SPECULAR_MAP" value="1"/>
    1515    <define name="USE_SELF_LIGHT" value="1"/>-->
    1616
    17     <define name="USE_AO" value="1"/>
    1817
    1918    <!-- Settings for effects above:
    2019         First value: Normal mapping intensity.
     
    2221     Third value: Parallax scale.
    2322     Fourth value: AO amount. -->
    2423    <uniform name="effectSettings" value="1.0 50.0 0.0075 0.85"/>
     24   
     25    <required_texture name="baseTex"/>
     26    <required_texture name="aoTex" define="USE_AO"/>
    2527</material>
  • binaries/data/mods/public/art/materials/terrain_triplanar_norm_spec.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<material>
    33    <shader effect="terrain_base"/>
    4     <define name="USE_NORMAL_MAP" value="1"/>
    5     <define name="USE_SPECULAR_MAP" value="1"/>
    64    <define name="USE_TRIPLANAR" value="1"/>
    75   
    86    <uniform name="effectSettings" value="1.0 15.0 0.0 0.0"/>
     7    <required_texture name="baseTex"/>
     8    <required_texture name="normTex" define="USE_NORMAL_MAP"/>
     9    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
    910</material>
  • binaries/data/mods/public/art/materials/basic_trans_wind.xml

     
    66    <renderquery name="sim_time"/>
    77    <define name="USE_WIND" value="1"/>
    88    <uniform name="windData" value="1.0 1.0"/>
     9    <required_texture name="baseTex"/>
    910</material>
  • binaries/data/mods/public/art/materials/no_trans_ao.xml

     
    1111    <!--<define name="USE_SPECULAR_MAP" value="1"/>
    1212    <define name="USE_SELF_LIGHT" value="1"/>-->
    1313
    14     <define name="USE_AO" value="1"/>
    1514
    1615    <!-- Settings for effects above:
    1716         First value: Normal mapping intensity.
     
    1918     Third value: Parallax scale.
    2019     Fourth value: AO amount. -->
    2120    <uniform name="effectSettings" value="1.0 50.0 0.0075 0.85"/>
     21   
     22    <required_texture name="baseTex"/>
     23    <required_texture name="aoTex" define="USE_AO"/>
    2224</material>
  • binaries/data/mods/public/art/materials/alphatest.xml

     
    33    <shader effect="model_transparent"/>
    44    <define name="USE_TRANSPARENT" value="1"/>
    55    <define name="USE_ALPHATEST" value="1"/>
     6    <required_texture name="baseTex"/>
     7
    68</material>
  • binaries/data/mods/public/art/materials/basic_specmap.xml

     
    1010          no specularity.
    1111     COMPATIBILITY: This effect is incompatible with the old "USE_SPECULAR" effect.
    1212     EFFICIENCY: This is a relatively inexpensive effect that should run easily on most hardware. -->
    13     <define name="USE_SPECULAR_MAP" value="1"/>
    1413   
    1514    <!-- Settings for effects above:
    1615     First value: Normal mapping intensity.
     
    1817     Third value: Parallax scale.
    1918     Fourth value: AO amount. -->
    2019    <uniform name="effectSettings" value="1.0 25.0 0.0075 0.85"/>
     20   
     21    <required_texture name="baseTex"/>
     22    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
    2123</material>
  • binaries/data/mods/public/art/materials/terrain_triplanar.xml

     
    44    <define name="USE_TRIPLANAR" value="1"/>
    55   
    66    <uniform name="effectSettings" value="1.0 15.0 0.0 0.0"/>
     7    <required_texture name="baseTex"/>
    78</material>
  • binaries/data/mods/public/art/materials/player_trans_parallax_spec.xml

     
    77    <conditional_define name="USE_PARALLAX_MAP" value="1" type="draw_range" conf="PARALLAX_DIST"/>
    88    <conditional_define name="USE_HQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_HQ_DIST"/>
    99    <conditional_define name="USE_VHQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_VHQ_DIST"/>
    10     <define name="USE_NORMAL_MAP" value="1"/>
    1110
    12     <define name="USE_SPECULAR_MAP" value="1"/>
    1311    <!-- <define name="USE_SELF_LIGHT" value="1"/> -->
    1412
    1513    <!--<define name="USE_AO" value="1"/>-->
     
    2018     Third value: Parallax scale.
    2119     Fourth value: AO amount. -->
    2220    <uniform name="effectSettings" value="1.0 50.0 0.0075 0.85"/>
     21   
     22    <required_texture name="baseTex"/>
     23    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
     24    <required_texture name="normTex" define="USE_NORMAL_MAP"/>
     25
    2326</material>
  • binaries/data/mods/public/art/materials/rock_bump_spec_ao_test.xml

     
    1717    <!-- REQUIRES: Actor must provide a texture named "normTex", where the RGB channels
    1818           are a normal map corresponding to XYZ normals.
    1919     EFFICIENCY: This is a relatively inexpensive effect that should run easily on most hardware. -->
    20     <define name="USE_NORMAL_MAP" value="1"/>
    2120   
    2221    <!-- REQUIRES: Actor must provide a texture named "specTex", where the RGB channels
    2322           provide a specular colour multiplier.
     
    2726          no specularity.
    2827     COMPATIBILITY: This effect is incompatible with the old "USE_SPECULAR" effect.
    2928     EFFICIENCY: This is a relatively inexpensive effect that should run easily on most hardware. -->
    30     <define name="USE_SPECULAR_MAP" value="1"/>
    3129   
    3230    <!-- REQUIRES: That "USE_SPECULAR_MAP" is enabled and a texture named "specTex" is provided by the Actor.
    3331           The Alpha channel of the texture defines the amount of self-illumination, with
     
    3937    <!-- REQUIRES: Actor must provide a texture named "aoTex", where the R channel is the Ambient Occlusion.
    4038                   The model must provide a second, non-overlapping set of UV coordinates.
    4139     COMMENT: The texture is combined using a multiply blend of (2 * ao * baseTex). -->
    42     <define name="USE_AO" value="1"/>
    4340   
    4441    <!-- Settings for effects above:
    4542         First value: Normal mapping intensity.
     
    4744     Third value: Parallax scale.
    4845     Fourth value: AO amount. -->
    4946    <uniform name="effectSettings" value="1.0 10.0 0.0075 0.85"/>
     47   
     48    <required_texture name="baseTex"/>
     49    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
     50    <required_texture name="normTex" define="USE_NORMAL_MAP"/>
     51    <required_texture name="aoTex" define="USE_AO"/>
     52
    5053</material>
  • binaries/data/mods/public/art/materials/player_trans_ao_parallax_spec.xml

     
    77    <conditional_define name="USE_PARALLAX_MAP" value="1" type="draw_range" conf="PARALLAX_DIST"/>
    88    <conditional_define name="USE_HQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_HQ_DIST"/>
    99    <conditional_define name="USE_VHQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_VHQ_DIST"/>
    10     <define name="USE_NORMAL_MAP" value="1"/>
    1110
    12     <define name="USE_SPECULAR_MAP" value="1"/>
    1311    <!-- <define name="USE_SELF_LIGHT" value="1"/> -->
    1412
    15     <define name="USE_AO" value="1"/>
    1613   
    1714    <!-- Settings for effects above:
    1815         First value: Normal mapping intensity.
     
    2017     Third value: Parallax scale.
    2118     Fourth value: AO amount. -->
    2219    <uniform name="effectSettings" value="1.0 50.0 0.0075 0.6"/>
     20   
     21    <required_texture name="baseTex"/>
     22    <required_texture name="normTex" define="USE_NORMAL_MAP"/>
     23    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
     24    <required_texture name="aoTex" define="USE_AO"/>
    2325</material>
  • binaries/data/mods/public/art/materials/player_trans_ao_spec.xml

     
    77    <!--<conditional_define name="USE_PARALLAX_MAP" value="1" type="draw_range" conf="PARALLAX_DIST"/>
    88    <conditional_define name="USE_HQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_HQ_DIST"/>
    99    <conditional_define name="USE_VHQ_PARALLAX" value="1" type="draw_range" conf="PARALLAX_VHQ_DIST"/>-->
    10     <define name="USE_NORMAL_MAP" value="1"/>
    1110
    12     <define name="USE_SPECULAR_MAP" value="1"/>
    1311    <!-- <define name="USE_SELF_LIGHT" value="1"/> -->
    1412
    15     <define name="USE_AO" value="1"/>
    1613   
    1714    <!-- Settings for effects above:
    1815         First value: Normal mapping intensity.
     
    2017     Third value: Parallax scale.
    2118     Fourth value: AO amount. -->
    2219    <uniform name="effectSettings" value="1.0 50.0 0.0075 0.85"/>
     20   
     21    <required_texture name="baseTex"/>
     22    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
     23    <required_texture name="normTex" define="USE_NORMAL_MAP"/>
     24    <required_texture name="aoTex" define="USE_AO"/>
     25
    2326</material>
  • binaries/data/mods/public/art/materials/player_trans_spec_helmet.xml

     
    33    <shader effect="model"/>
    44    <alternative material="player_trans.xml" quality="1"/>
    55    <define name="USE_PLAYERCOLOR" value="1"/>
    6     <define name="USE_SPECULAR_MAP" value="1"/>
    76    <!-- <define name="USE_SELF_LIGHT" value="1"/> -->
    87
    98    <!-- Settings for effects above:
     
    1211     Third value: Parallax scale.
    1312     Fourth value: AO amount. -->
    1413    <uniform name="effectSettings" value="1.0 20.0 0.0075 0.85"/>
     14   
     15    <required_texture name="baseTex"/>
     16    <required_texture name="specTex" define="USE_SPECULAR_MAP"/>
     17
    1518</material>
  • binaries/data/mods/public/art/materials/default.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<material>
    33    <shader effect="model"/>
     4    <required_texture name="baseTex"/>
    45</material>
  • source/graphics/ObjectBase.h

     
    2828#include <boost/unordered_set.hpp>
    2929#include "lib/file/vfs/vfs_path.h"
    3030#include "ps/CStr.h"
     31#include "ps/CStrIntern.h"
    3132
    3233#include <boost/random/mersenne_twister.hpp>
    3334
     
    7071    struct Samp
    7172    {
    7273        // identifier name of sampler in GLSL shaders
    73         CStr m_SamplerName;
     74        CStrIntern m_SamplerName;
    7475        // path to load from
    7576        VfsPath m_SamplerFile;
    7677    };
  • source/graphics/Material.h

     
    3131   
    3232    struct TextureSampler
    3333    {
    34         TextureSampler(CStr &n, CTexturePtr t) : Name(n), Sampler(t) {}
     34        TextureSampler(const CStr &n, CTexturePtr t) : Name(n), Sampler(t) {}
     35        TextureSampler(const CStrIntern &n, CTexturePtr t) : Name(n), Sampler(t) {}
    3536       
    3637        CStrIntern Name;
    3738        CTexturePtr Sampler;
     
    7475    void AddRenderQuery(const char* key);
    7576    const CShaderRenderQueries& GetRenderQueries() const { return m_RenderQueries; }
    7677
     78    void AddRequiredSampler(const CStr& samplerName);
     79    const std::vector<CStrIntern>& GetRequiredSampler() const { return m_RequiredSamplers; }
     80
    7781    // Must be called after all AddShaderDefine and AddConditionalDefine
    7882    void RecomputeCombinedShaderDefines();
    7983
     
    8488    CTexturePtr m_DiffuseTexture;
    8589   
    8690    SamplersVector m_Samplers;
     91    std::vector<CStrIntern> m_RequiredSamplers;
    8792   
    8893    CStrIntern m_ShaderEffect;
    8994    CShaderDefines m_ShaderDefines;
  • source/graphics/ObjectEntry.cpp

     
    149149        model->GetMaterial().AddSampler(CMaterial::TextureSampler(samp->m_SamplerName, texture));
    150150    }
    151151
     152    const std::vector<CStrIntern>& requiredSamplers = model->GetMaterial().GetRequiredSampler();
     153    for (auto it : requiredSamplers)
     154    {
     155        bool found = false;
     156        for (auto sampit : m_Samplers)
     157            if (sampit.m_SamplerName == it)
     158            {
     159                found = true;
     160                break;
     161            }
     162        if (!found)
     163        {
     164            LOGERROR("Actor %s: required texture sampler %s not found (material %s)", m_ModelName.string8().c_str(), it.string().c_str(), m_Base->m_Material.string8().c_str());
     165        }
     166    }
     167   
    152168    // calculate initial object space bounds, based on vertex positions
    153169    model->CalcStaticObjectBounds();
    154170
  • source/graphics/ObjectBase.cpp

     
    164164                                if (se.Name == at_file)
    165165                                    samp.m_SamplerFile = VfsPath("art/textures/skins") / se.Value.FromUTF8();
    166166                                else if (se.Name == at_name)
    167                                     samp.m_SamplerName = se.Value;
     167                                    samp.m_SamplerName = CStrIntern(se.Value);
    168168                            }
    169169                            currentVariant->m_Samplers.push_back(samp);
    170170                        }
     
    459459       
    460460        // Same for samplers, though perhaps not strictly necessary:
    461461        for (std::vector<CObjectBase::Samp>::iterator it = var.m_Samplers.begin(); it != var.m_Samplers.end(); ++it)
    462             variation.samplers.erase(it->m_SamplerName);
     462            variation.samplers.erase(it->m_SamplerName.string());
    463463        for (std::vector<CObjectBase::Samp>::iterator it = var.m_Samplers.begin(); it != var.m_Samplers.end(); ++it)
    464             variation.samplers.insert(make_pair(it->m_SamplerName, *it));
     464            variation.samplers.insert(make_pair(it->m_SamplerName.string(), *it));
    465465    }
    466466
    467467    return variation;
  • source/graphics/MaterialManager.cpp

     
    5858    EL(shader);
    5959    EL(uniform);
    6060    EL(renderquery);
     61    EL(required_texture);
    6162    EL(conditional_define);
    6263    AT(effect);
    6364    AT(if);
     65    AT(define);
    6466    AT(quality);
    6567    AT(material);
    6668    AT(name);
     
    180182        {
    181183            material.AddRenderQuery(attrs.GetNamedItem(at_name).c_str());
    182184        }
     185        else if (token == el_required_texture)
     186        {
     187            material.AddRequiredSampler(attrs.GetNamedItem(at_name));
     188            if (!attrs.GetNamedItem(at_define).empty())
     189                material.AddShaderDefine(CStrIntern(attrs.GetNamedItem(at_define)), str_1);
    183190    }
     191    }
    184192
    185193    material.RecomputeCombinedShaderDefines();
    186194
  • source/graphics/Material.cpp

     
    6060    m_RenderQueries.Add(key);
    6161}
    6262
     63void CMaterial::AddRequiredSampler(const CStr& samplerName)
     64{
     65    CStrIntern string(samplerName);
     66    m_RequiredSamplers.push_back(string);
     67}
     68
     69
    6370// Set up m_CombinedShaderDefines so that index i contains m_ShaderDefines, plus
    6471// the extra defines from m_ConditionalDefines[j] for all j where bit j is set in i.
    6572// This lets GetShaderDefines() cheaply return the defines for any combination of conditions.