Garry's Mod Wiki

IMaterial:SetTexture

void IMaterial:SetTexture( string materialTexture, ITexture texture )

Description

Sets the specified material texture to the specified texture, does nothing on a type mismatch.

Arguments

1 string materialTexture
The name of the keyvalue on the material to store the texture on.
2 ITexture texture
The new texture. This can also be a string, the name of the new texture.

Example

Example usage of this function.

local blur_mat = Material( "pp/bokehblur" ) blur_mat:SetTexture( "$basetexture", render.GetScreenEffectTexture() )

Example

Equivalent of Example 1, demonstrating the use of a texture's name.

local blur_mat = Material( "pp/bokehblur" ) blur_mat:SetTexture( "$basetexture", "_rt_fullframefb" )

Page Links


Special Pages


Wikis

?

Render Time: 27ms

Session 0
DB GetPage 4
Generate Html 1
SaveChanges 8
Render Body 0
Render Sidebar 12