Material.GetTexture

Material.GetTexture method

Gets the texture from the specified slot, it can be material’s property name or shader’s parameter name

public TextureBase GetTexture(string slotName)
ParameterTypeDescription
slotNameStringSlot name.

Return Value

The texture.

Examples

var mat = new LambertMaterial();
var tex = new Texture();
tex.FileName = "diffuse.png";
mat.SetTexture(Material.MapDiffuse, tex);
tex = (Texture)mat.GetTexture(Material.MapDiffuse);

See Also