| Description | Hierarchy | Fields | Methods | Properties |
type TMaterial = record
Struct for holding parameters for a material renderer.
You may notice that some methods and fields from irr::SMaterial are missing. SMaterial Methods accessing texture properties simply forward attributes or methods of TMaterialLayer. The flag attributes are packed in the source code and therefore not portable. Use SetFlag / GetFlag instead.
TextureLayer: array[0..MaxMaterialTextures-1] of TMaterialLayer; |
MaterialType: EnumType; |
AmbientColor: TARGBColor; |
DiffuseColor: TARGBColor; |
EmissiveColor: TARGBColor; |
SpecularColor: TARGBColor; |
Shininess: Single; |
MaterialTypeParam: Single; |
MaterialTypeParam2: Single; |
Thickness: Single; |
function GetFlag(Flag: TMaterialFlag): Boolean; inline; |
procedure Reset; inline; |
procedure SetFlag(Flag: TMaterialFlag; Value: Boolean); inline; |
property ColorMask: LongWord read GetColorMask write SetColorMask; |
property ColorMaterial: LongWord read GetColorMaterial write SetColorMaterial; |
TextureLayer: array[0..MaxMaterialTextures-1] of TMaterialLayer; |
MaterialType: EnumType; |
|
Type of the material. Specifies how everything is blended together. |
AmbientColor: TARGBColor; |
|
Specifies how much ambient light (a global light) is reflected by this material. |
DiffuseColor: TARGBColor; |
|
How much diffuse light coming from a light source is reflected by this material. |
EmissiveColor: TARGBColor; |
|
Light emitted by this material. Default is to emit no light. |
SpecularColor: TARGBColor; |
|
How much specular light (highlights from a light) is reflected. |
Shininess: Single; |
|
Value affecting the size of specular highlights.
SceneNode.Materials[0]ˆ.Shininess := 20;
You can change the color of the highlights using
SceneNode.Materials[0]ˆ.SpecularColor := ARGBColor(255,255,255,255);
The specular color of the dynamic lights (TLight.SpecularColor) will influence the the highlight color too, but they are set to a useful value by default when creating the light scene node. Here is a simple example on how to use specular highlights:
// load and display mesh
var Node: TAnimatedMeshSceneNode;
Light: TLightSceneNode;
...
Node := SceneManager.AddAnimatedMeshSceneNode(SceneManager.GetMesh('data/faerie.md2'));
Node.SetMaterialTexture(0, VideoDriver.GetTexture("data/Faerie2.pcx")); // set diffuse texture
Node.SetMaterialFlag(mfLighting, True); // enable dynamic lighting
Node.Materials[0].Shininess := 20; // set size of specular highlights
// add white light
Light = SceneManager.AddLightSceneNode(nil, Vector3D(5,5,5), ARGBColor(1.0f, 1.0f, 1.0f));
|
MaterialTypeParam: Single; |
|
Free parameter, dependent on the material type. |
MaterialTypeParam2: Single; |
|
Second free parameter, dependent on the material type. |
Thickness: Single; |
|
|
function GetFlag(Flag: TMaterialFlag): Boolean; inline; |
|
Gets a material flag. Parameters
ReturnsBoolean indicating whether the flag is set. |
procedure Reset; inline; |
procedure SetFlag(Flag: TMaterialFlag; Value: Boolean); inline; |
|
Modifies a material flag. Parameters
|
property ColorMask: LongWord read GetColorMask write SetColorMask; |
|
Defines the enabled color planes. |
property ColorMaterial: LongWord read GetColorMaterial write SetColorMaterial; |
|
Defines the interpretation of vertex color in the lighting equation. |