render.ModelMaterialOverride

From Garry's Mod
Jump to: navigation, search
 render.ModelMaterialOverride( )

Contents

Description

Sets a material to override a model's default material. Similar to Entity:SetMaterial except it uses an IMaterial argument and it can be used to change materials on models which are part of the world geometry.

Arguments

IMaterial material

The material override.

Examples

Example

Sets the material of all opaque models to the red flashing "ERROR" texture.

local error_mat = Material("models/error/new light1")

function GM:PreDrawOpaqueRenderables(bDrawingDepth, bDrawingSkybox)

	render.ModelMaterialOverride(error_mat)
	
end


Personal tools
Navigation