material_t

in all examples below mat is an instance of material_t

Functions

get_name

gets the material name

string get_name()

Example

print(mat:get_name())

get_texture_group_name

gets the material group name

string get_texture_group_name()

Example

print(mat:get_texture_group_name())

alpha_modulate

modulates the current materials alpha property

void alpha_modulate(<float> alpha_factor)

Example

print(mat:alpha_modulate(0.5)) -- force 50% alpha

color_modulate

modulates the current materials color property

void color_modulate(<float> red_factor,<float> green_factor, <float> blue_factor)

Example

print(mat:color_modulate(1.0, 0.0, 0.0)) -- force red tint

get_flag

checks whether this material has the flag active

bool get_flag(<e_material_flags> flag)

Example

print(mat:get_flag(e_material_flags.IGNOREZ))

set_flag

activates the flag for the material

void set_flag(<e_material_flags> flag, bool value)

Example

mat:set_flag(e_material_flags.IGNOREZ, true)

get_address

gets raw address of material pointer

uint get_address()

set_shader_param

sets shader param to either an int, string, float or vec3_t

void set_shader_param(<string> param_name, <int/float/vec3_t/string> val)

get_shader_param

returns shader param as either an int, string, float or vec3_t

int/float/vec3_t/string get_shader_param(<string> param_name)

Last updated