ent_mtlset (ENTITY*, MATERIAL*, var
Replaces a model's skin lighting and skin effect
that was set in MED. This function can be used for assigning different effects to different entity skins.
||Target entity pointer (models or nonchunked terrain
||Source material pointer. If
the entity skin contains no material, it gets the light
parameters from the source material. If it already
contains a material,
its light parameters are replaced by the source material lighting.
If the source
an effect or shader, it replaces the skin effect.
||Number of the skin
(as in MED)
starting with 1. If the skin does not exist, it is automatically created and the entity skin number is increased.
NULL if the skin material could not be set,
otherwise a MATERIAL* pointer with the original effect.
ENTITY - the model's skin
lighting and skin effect are modified. Material parameters that do not belong to
a skin - for instance material skills or matrices -
are not modified.
- Setting a skin material affects all entities sharing that model file unless ent_clone or ent_cloneskin was called before.
For getting a pointer to the original material effect, call this function with NULL for returning the source material pointer.
This function does not set the entity material parameter. When the effect uses material skins or parameters, the material must be assigned to the entity. Material skins and parameters are shared by all skin effects .
ent_mtlset(me,mtl_new,1); // replaces the ligthing and effect of the first entity skin
Skin Parameters, MATERIAL,