类 TextureSlot

TextureSlot class

Material 中的纹理槽(Material),可以通过材质实例进行枚举。

public class TextureSlot

属性

名称描述
SlotName { get; }指示此纹理将绑定到的槽名称。
Texture { get; }将绑定到材质的纹理。

示例

var mat = new LambertMaterial();
var tex = new Texture();
tex.FileName = "diffuse.png";
mat.SetTexture(Material.MapDiffuse, tex);
foreach(var slot in mat)
{
    Console.WriteLine($"Texture slot {slot.SlotName} = {slot.Texture}");
}

另请参见