materialsystem
Functions controlling the CS:GO Material System, letting you modulate, swap, remove materials and set their shader params / material vars
materialsystem.arms_material
materialsystem.arms_material(): table (material object)
Returns a reference to the arms material when 'Viewmodel arms' is enabled
materialsystem.chams_material
materialsystem.chams_material(): table (material object)
Returns a reference to the player chams material
materialsystem.find_material
materialsystem.find_material(path: string[, force_load: boolean]): table (material object)
Path to material including filename
Boolean. Load the material if it isn't loaded
Returns a reference to the material
materialsystem.find_materials
materialsystem.find_materials(partial_path: string[, force_load: boolean]): table (material objects)
Boolean. Load each material if it isn't loaded
Returns a table of references to materials that have partial_path in their name
materialsystem.find_texture
materialsystem.find_texture(path: string)
Path to texture including filename
Returns a reference to the texture that can be used with set_shader_param
materialsystem.get_model_materials
materialsystem.get_model_materials(entindex: number): table (material objects)
Returns a table of references to materials used by the entity
materialsystem.override_material
materialsystem.override_material(material: table, material_new: table)
The material to override it with
Overrides all of a material properties with another material.
:alpha_modulate
material_object:alpha_modulate(a: number)
New alpha value of the material (0-255)
Overrides the alpha of the material object it's called on. Doesn't work with some materials
:color_modulate
material_object:color_modulate(r: number, g: number, b: number)
New red value of the material (0-255)
New green value of the material (0-255)
New blue value of the material (0-255)
Overrides the color of the material object it's called on. Doesn't work with some materials
:get_material_var_flag
material_object:get_material_var_flag(material_var_flag: number): boolean
number (material var flag)
Material var flag as number
Returns the boolean value of the material var flag
material_object:get_name(): string
Returns name of the material
:get_shader_param
material_object:get_shader_param(shader_param: string): any
Returns the value of the shader param or nil
material_object:reload()
Restores the original material properties of the material it's called on.
:set_material_var_flag
material_object:set_material_var_flag(material_var_flag: number, value: any)
number (material var flag)
Material var flag as number
New boolean value of the material var flag
Sets the value of the material var flag of the material
:set_shader_param
material_object:set_shader_param(shader_param: string, value: any)
New value of the shader param
Sets the value of the shader param of the material