AddMaterialLayer()

Syntax

AddMaterialLayer(#Material, TextureID [, Mode [, TextureCoordinateIndex]])
Description
Adds a new layer to the material and put the specified texture in it.

Parameters

#Material The material to use.
TextureID The texture to add. A valid 'TextureID' can be easily obtained with TextureID().
Mode (optional) It can be one of the following values:
  #PB_Material_Add        : Performs a pixel 'Add' operation over previous layer (black color is like transparent)
  #PB_Material_AddSigned  : Performs a pixel signed 'Add' operation over previous layer (black color is like transparent)
  #PB_Material_Substract  : Performs a pixel 'Substract' operation over previous layer (black color is like transparent)
  #PB_Material_Replace    : Performs a pixel 'Replace' operation over previous layer
  #PB_Material_AlphaBlend : Use the AlphaChannel layer of the texture (should be a TGA or PNG one) and blend it with the previous layer
  #PB_Material_Modulate   : Performs a pixel 'Multiply' operation over previous layer
  #PB_Material_ModulateX2 : Performs a pixel 'Multiply' operation over previous layer and brighten afterwards (x2)
  #PB_Material_ModulateX4 : Performs a pixel 'Multiply' operation over previous layer and brighten afterwards (x4)
  #PB_Material_BlendDiffuseAlpha: Use the AlphaChannel layer of the texture and blend it with the previous layer with diffuse
  #PB_Material_BlendCurrentAlpha: Use the AlphaChannel layer of the current stage and blend it with the previous layer
TextureCoordinateIndex (optional) Texture coordinate index (default value is 0).

Return value

None.

See Also

RemoveMaterialLayer()

Supported OS

All

Material Index - CopyMaterial() ->