mtl
The current material in a material event;
can be used to switch material properties
or A7
whole materials at runtime.
Type:
MATERIAL*
Example:
// use different material effects depending on the view - use ENABLE_TREE
if (render_view == camera) { mtl.ambient_red = 255; }
...
// switch the material depending on the view - use ENABLE_RENDER
function mtl_event_render()
{
if (render_view == view_radar) {
mtl = mtl_radar; return(0);
}
if (render_view == view_depth) {
mtl = mtl_depth; return(0);
}
}
...
MATERIAL* mtl_plain =
{
event = mtl_event_render;
flags = ENABLE_RENDER;
...
}
See also:
material.event,
render_view, material flags