Material

csharp
public sealed class Material : Asset

Namespace NodeWorld.Flux.

A material of the world. Changing it changes every renderer of the world that uses it (Renderer.SetFloat... changes one renderer).

Properties

shader

csharp
public ShaderAsset shader { get; set; }

The shader of the material; set it to the shader of another material of the world (its values stay).

renderQueue

csharp
public int renderQueue { get; set; }

Render queue of the material; -1: the shader's.

color

csharp
public Color color { get; set; }

The main color of the material (its [MainColor] property, or _Color).

shaderKeywords

csharp
public string[] shaderKeywords { get; set; }

The shader keywords enabled on the material.

Methods

HasProperty

csharp
public bool HasProperty(string name)

The material's shader has a property of this name.

SetFloat

csharp
public void SetFloat(string name, float value)

Sets a float property of the material, for every renderer that uses it.

SetColor

csharp
public void SetColor(string name, Color value)

Sets a color property of the material, for every renderer that uses it.

SetVector

csharp
public void SetVector(string name, Vector4 value)

Sets a vector property of the material, for every renderer that uses it.

SetTexture

csharp
public void SetTexture(string name, Texture texture)

Sets a texture property of the material, for every renderer that uses it (null: no texture).

GetFloat

csharp
public float GetFloat(string name)

A float property of the material.

GetColor

csharp
public Color GetColor(string name)

A color property of the material.

GetVector

csharp
public Vector4 GetVector(string name)

A vector property of the material.