Scripting API

Scripting API

ShaderLayout

Record in Abyss.Core, from Abyss.Core.

What a shader takes: its values, and the names of its textures.

public record ShaderLayout

Remarks

Read out of the shader's own file — the struct at its material binding 0, and the textures at bindings 1, 3, 5 and 7 — so a script sets a value by the name the shader gave it, and nothing declares the shader's values twice. See World.LoadShader.

Constructors

ShaderLayout

public ShaderLayout(IReadOnlyList<ShaderValue> Values, IReadOnlyList<string?> Textures, int Size, ShaderKind Draws = Mesh)

What a shader takes: its values, and the names of its textures.

Parameters

  • Values: Its values, in the order its struct declares them.
  • Textures: The texture at each of the four slots, or null where it has none.
  • Size: How many bytes its values take, at most 256.
  • Draws: What it draws: a mesh's surface, or a UI element.

Read out of the shader's own file — the struct at its material binding 0, and the textures at bindings 1, 3, 5 and 7 — so a script sets a value by the name the shader gave it, and nothing declares the shader's values twice. See World.LoadShader.

Properties

Values

public IReadOnlyList<ShaderValue> Values { get; init; }

Its values, in the order its struct declares them.

Textures

public IReadOnlyList<string?> Textures { get; init; }

The texture at each of the four slots, or null where it has none.

Size

public int Size { get; init; }

How many bytes its values take, at most 256.

Draws

public ShaderKind Draws { get; init; }

What it draws: a mesh's surface, or a UI element.

Methods

Value

public ShaderValue? Value(string name)

The value called name, or null if the shader takes none.

Parameters

  • name