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:
See TMaterialProperties docs.
In code, you have to load this file like this:
Deprecated: Function create_function() is deprecated in /var/www/cge-www-preview/geshi/geshi.php on line 4751
uses ..., CastleMaterialProperties; ... MaterialProperties.URL := ApplicationData('material_properties.xml');
It's usually best to do it as early as possible, for example
at the beginning on
Application.OnInitialize (if you
(if you use
CastleControl in Lazarus).
This is a sample
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="TEST" /> <!-- You can use as many <property> elements as you like... --> <!-- You can also use <auto_generated_textures> elements as documented in the next chapter: <auto_generated_textures>...</auto_generated_textures> --> </properties>
Copyright Michalis Kamburelis and others. Particular thanks go to Paweł Wojciechowicz from Cat-astrophe Games for various graphics. Even this documentation is open-source and you can redistribute it on open-source terms, in particular CC BY-SA.