7. Material properties configuration

You can configure material properties using an XML file. This is useful to configure behavior that is naturally dependent on a given material or texture. Right now this allows to define things like footsteps, toxic ground (hurts player), and bump mapping. See TMaterialProperty docs.

In code, you have to load this file like this:

uses ..., CastleMaterialProperties;
 
...
MaterialProperties.URL := ApplicationData('data/material_properties.xml');

Below is a sample material_properties.xml file with links to documentation for every attribute.

<?xml version="1.0"?>

<properties>
  <!--
    Contains a list of <property> elements.
    Only the "texture_base_name" attribute is required, and it must be unique.
  -->

  <property
    texture_base_name="test_texture"
    footsteps_sound="">
    <toxic>
      <damage
        const="0.0"
        random="0.0"
        time="0.0" />
    </toxic>
  </property>

  <property
    texture_base_name="test_texture_2"
    normal_map="test_normal_map.png"
    alpha_channel="SIMPLE_YES_NO" />

  <!-- And more <property> elements... -->
</properties>