Garry's Mod Wiki

render.ModelMaterialOverride

  render.ModelMaterialOverride( IMaterial material = nil )

Description

Forces all future draw operations to use a specific IMaterial.

Because this is independent of a specific Entity, it can be used to change materials on static models that are part of maps.

In certain scenarios such as during entity's shadow pass, using this function can cause unexpected side effects. See example on render.MaterialOverride about dealing with this.

Arguments

1 IMaterial material = nil
The IMaterial that will be used for all upcoming draw operations, or nil to stop overriding.