Table of Contents

Struct Material

Namespace
BSGameLib.Game
Assembly
BSGameLib.Game.dll

Identifies a material registered with ShaderManager. Custom materials can be created via Create(string).

public readonly record struct Material : IComparable<Material>, IEquatable<Material>
Implements
Inherited Members
Extension Methods

Properties

Id

Unique identifier for the material.

public string Id { get; }

Property Value

string

ImmediateSprite

Sprites drawn straight to the render device, not through a batch.

public static Material ImmediateSprite { get; }

Property Value

Material

IsValid

Whether the material has an id. A default Material is not valid.

public bool IsValid { get; }

Property Value

bool

Lit

A sprite drawn with the scene's ambient colour and point lights.

public static Material Lit { get; }

Property Value

Material

None

A placeholder with no shader. The sprite batch renderer uses it to mean that no material is set yet.

public static Material None { get; }

Property Value

Material

Shape

The material that shapes are drawn with.

public static Material Shape { get; }

Property Value

Material

Unlit

A sprite drawn without lighting.

public static Material Unlit { get; }

Property Value

Material

Veil

A sprite laid over a lit scene that light clears instead of brightening: mist, smoke, a colour wash. It takes the ambient colour as a lit sprite does, so it darkens with the scene, and thins where point lights fall, so what is under a light shows through it.

public static Material Veil { get; }

Property Value

Material

Methods

CompareTo(Material)

Orders materials by their ids.

public int CompareTo(Material other)

Parameters

other Material

Returns

int

Create(string)

Creates a material with a custom id, to register with ShaderManager.

public static Material Create(string id)

Parameters

id string

Returns

Material

Exceptions

ArgumentException

id is blank.

ToString()

The material's id.

public override string ToString()

Returns

string

Operators

operator >(Material, Material)

Whether left sorts after right, by id.

public static bool operator >(Material left, Material right)

Parameters

left Material
right Material

Returns

bool

operator >=(Material, Material)

Whether left sorts after or equal to right, by id.

public static bool operator >=(Material left, Material right)

Parameters

left Material
right Material

Returns

bool

operator <(Material, Material)

Whether left sorts before right, by id.

public static bool operator <(Material left, Material right)

Parameters

left Material
right Material

Returns

bool

operator <=(Material, Material)

Whether left sorts before or equal to right, by id.

public static bool operator <=(Material left, Material right)

Parameters

left Material
right Material

Returns

bool