Skip to content

raylib.SetMaterialTexture

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) NOTE: Previous texture should be manually unloaded

Parameters

Parameter Default Value Note
material
mapType
texture

Return value

None.

Notes

Example

mat = raylib.LoadMaterialDefault
tex = raylib.LoadTexture("diffuse.png")
raylib.SetMaterialTexture mat, raylib.MATERIAL_MAP_DIFFUSE, tex
// mat now uses tex as its diffuse texture
raylib.UnloadMaterial mat
raylib.UnloadTexture tex

Clone this wiki locally