Castle Game Engine: CastleMaterialProperties: Class TMaterialProperty

# Class TMaterialProperty
Description | Hierarchy | Fields | Methods | Properties
## Unit CastleMaterialProperties ## Declaration `type TMaterialProperty = class(TObject)` ## Description Store information that is naturally associated with a given material or texture in an external file. Right now this allows to define things like footsteps, toxic ground (hurts player), and bump mapping. In the future, it should be possible to express all these properties in pure VRML/X3D (inside Appearance / Material / ImageTexture nodes). Right now, you can do this with bump mapping, see http://castle-engine.sourceforge.net/x3d_extensions.php#section_ext_bump_mapping , but not footsteps or toxic ground. In the future it should also be possible to express these properties in 3D authoring software (like Blender), and easily export them to appropriate VRML/X3D nodes. For now, this `TMaterialProperty` allows us to easily customize materials in a way that is not possible in Blender. Using an external file for material properties has also long-term advantages: it can be shared across many 3D models, for example you can define footsteps sound for all grounds using the `grass.png` textures, in all levels, at once. You have to load an XML file by setting MaterialProperties.URL property. ## Hierarchy TObject TMaterialProperty ## Overview ### Properties
| `property TextureBaseName: string read FTextureBaseName write FTextureBaseName;`
| `property FootstepsSound: TSoundType read FFootstepsSound write FFootstepsSound;`
| `property Toxic: boolean read FToxic write FToxic;`
| `property ToxicDamageConst: Single read FToxicDamageConst write FToxicDamageConst;`
| `property ToxicDamageRandom: Single read FToxicDamageRandom write FToxicDamageRandom;`
| `property ToxicDamageTime: Single read FToxicDamageTime write FToxicDamageTime;`
| `property NormalMap: string read FNormalMap write FNormalMap;`
| `property AlphaChannel: string read FAlphaChannel write FAlphaChannel;`
## Description ### Properties
| `property TextureBaseName: string read FTextureBaseName write FTextureBaseName;`
Texture basename to associate this property will all appearances using given texture. For now, this is the only way to associate property, but more are possible in the future (like MaterialNodeName).
| `property FootstepsSound: TSoundType read FFootstepsSound write FFootstepsSound;`
Footsteps sound to make when player is walking on this material. stNone is no information is available.
| `property Toxic: boolean read FToxic write FToxic;`
Is the floor `toxic` when walking on it.
| `property ToxicDamageConst: Single read FToxicDamageConst write FToxicDamageConst;`
| `property ToxicDamageRandom: Single read FToxicDamageRandom write FToxicDamageRandom;`
| `property ToxicDamageTime: Single read FToxicDamageTime write FToxicDamageTime;`
| `property NormalMap: string read FNormalMap write FNormalMap;`
Normal map texture URL. This is a simple method to activate bump mapping, equivalent to using `normalMap` field in an Appearance node of VRML/X3D, see http://castle-engine.sourceforge.net/x3d_extensions.php#section_ext_bump_mapping . In case both VRML/X3D Appearance specifies `normalMap` and we have `NormalMap` defined here, the VRML/X3D Appearance is used.
| `property AlphaChannel: string read FAlphaChannel write FAlphaChannel;`
Override alpha channel type for diffuse texture. The meaning and allowed values for this are the same as for `alphaChannel` field for texture nodes, see http://castle-engine.sourceforge.net/x3d_extensions.php#section_ext_alpha_channel_detection . Empty value (default) doesn't change the alpha channel type (set in VRML/X3D or auto-detected).
Generated by PasDoc 0.13.0 on 2013-08-17 21:27:13