Xui.GPU.Shaders.Types

Assembly: Xui.Core · C# declarations · Assembly overview

Types

enum AddressMode

Represents texture sampling addressing modes.

public enum AddressMode
{
    Repeat,
    ClampToEdge,
    MirroredRepeat,
    ClampToBorder,
}

AddressMode.ClampToBorder

ClampToBorder

Texture coordinates outside [0, 1] return a border color.

AddressMode.ClampToEdge

ClampToEdge

Texture coordinates are clamped to the edge.

AddressMode.MirroredRepeat

MirroredRepeat

Texture coordinates mirror at the boundaries.

AddressMode.Repeat

Repeat

Texture coordinates wrap at the boundaries (repeat).

readonly struct Bool

Shader boolean type.

public readonly struct Bool
{
    public Bool(bool value);
    public static Bool False { get; }
    public static Bool True { get; }

    public static implicit operator Bool(bool value);
    public static implicit operator bool (Bool value);
    public static Bool operator ==(Bool left, Bool right);
    public static Bool operator !=(Bool left, Bool right);
    public static Bool operator &(Bool left, Bool right);
    public static Bool operator |(Bool left, Bool right);
    public static Bool operator !(Bool value);
    public override bool Equals(object? obj);
    public override int GetHashCode();
    public override string ToString();
}

Bool.Bool(bool value)

public Bool(bool value);

Initializes a new instance of the Xui.GPU.Shaders.Types.Bool struct.

  • value — The bool value.

bool Bool.Equals(object? obj)

public override bool Equals(object? obj);

Indicates whether this instance and a specified object are equal.

  • obj — The object to compare with the current instance.

Returns: true if obj and this instance are the same type and represent the same value; otherwise, false.

Bool Bool.False

public static Bool False { get; }

Gets the false constant.

int Bool.GetHashCode()

public override int GetHashCode();

Returns the hash code for this instance.

Returns: A 32-bit signed integer that is the hash code for this instance.

string Bool.ToString()

public override string ToString();

Returns the fully qualified type name of this instance.

Returns: The fully qualified type name.

Bool Bool.True

public static Bool True { get; }

Gets the true constant.

Bool Bool.operator &(Bool left, Bool right)

public static Bool operator &(Bool left, Bool right);

Performs logical AND of two Bool values.

Bool Bool.operator |(Bool left, Bool right)

public static Bool operator |(Bool left, Bool right);

Performs logical OR of two Bool values.

Bool Bool.operator ==(Bool left, Bool right)

public static Bool operator ==(Bool left, Bool right);

Tests equality of two Bool values.

Bool.implicit operator Bool(bool value)

public static implicit operator Bool(bool value);

Converts from bool to Bool.

Bool.implicit operator bool(Bool value)

public static implicit operator bool (Bool value);

Converts from Bool to bool.

Bool Bool.operator !=(Bool left, Bool right)

public static Bool operator !=(Bool left, Bool right);

Tests inequality of two Bool values.

Bool Bool.operator !(Bool value)

public static Bool operator !(Bool value);

Performs logical NOT of a Bool value.

struct Color4

A 4-component RGBA color value.

public struct Color4
{
    public F32 R;
    public F32 G;
    public F32 B;
    public F32 A;
    public Color4(F32 r, F32 g, F32 b, F32 a);
    public Color4(F32 r, F32 g, F32 b);
    public static Color4 White { get; }
    public static Color4 Black { get; }
    public static Color4 Transparent { get; }

    public static Color4 operator +(Color4 a, Color4 b);
    public static Color4 operator *(Color4 left, Color4 right);
    public static Color4 operator *(Color4 left, F32 right);
    public static implicit operator Color4(Xui.Core.Canvas.Color color);
    public static implicit operator Color4(uint rgba);
    public override string ToString();
}

Color4.Color4(F32 r, F32 g, F32 b)

public Color4(F32 r, F32 g, F32 b);

Initializes a new instance from RGB values with alpha set to 1.

Color4.Color4(F32 r, F32 g, F32 b, F32 a)

public Color4(F32 r, F32 g, F32 b, F32 a);

Initializes a new instance of the Xui.GPU.Shaders.Types.Color4 struct.

F32 Color4.A

public F32 A;

The alpha component.

F32 Color4.B

public F32 B;

The blue component.

Color4 Color4.Black

public static Color4 Black { get; }

Gets a black color (0, 0, 0, 1).

F32 Color4.G

public F32 G;

The green component.

F32 Color4.R

public F32 R;

The red component.

string Color4.ToString()

public override string ToString();

Returns the fully qualified type name of this instance.

Returns: The fully qualified type name.

Color4 Color4.Transparent

public static Color4 Transparent { get; }

Gets a transparent color (0, 0, 0, 0).

Color4 Color4.White

public static Color4 White { get; }

Gets a white color (1, 1, 1, 1).

Color4 Color4.operator +(Color4 a, Color4 b)

public static Color4 operator +(Color4 a, Color4 b);

Adds color components without clamping.

Color4.implicit operator Color4(uint rgba)

public static implicit operator Color4(uint rgba);

Implicitly converts a packed 32-bit RGBA value (0xRRGGBBAA) to a Xui.GPU.Shaders.Types.Color4. Compatible with Xui.Core.Canvas.Colors web color constants.

Color4.implicit operator Color4(Color color)

public static implicit operator Color4(Xui.Core.Canvas.Color color);

Implicitly converts from Xui.Core.Canvas.Color to Xui.GPU.Shaders.Types.Color4.

Color4 Color4.operator *(Color4 left, Color4 right)

public static Color4 operator *(Color4 left, Color4 right);

Multiplies two colors component-wise.

Color4 Color4.operator *(Color4 left, F32 right)

public static Color4 operator *(Color4 left, F32 right);

Multiplies a color by a scalar.

readonly struct F32

Shader 32-bit floating-point scalar type. This is the fundamental scalar type for shader math operations.

In CPU execution, this may be represented as a single float (in vertex stage) or as a quad of floats (in fragment stage for derivative support).

public readonly struct F32
{
    public F32(float value);
    public static F32 Zero { get; }
    public static F32 One { get; }

    public static implicit operator F32(float value);
    public static implicit operator F32(double value);
    public static implicit operator F32(nfloat value);
    public static implicit operator float (F32 value);
    public static implicit operator double (F32 value);
    public static implicit operator nfloat(F32 value);
    public static F32 operator +(F32 left, F32 right);
    public static F32 operator -(F32 left, F32 right);
    public static F32 operator *(F32 left, F32 right);
    public static F32 operator /(F32 left, F32 right);
    public static F32 operator -(F32 value);
    public static Bool operator ==(F32 left, F32 right);
    public static Bool operator !=(F32 left, F32 right);
    public static Bool operator <(F32 left, F32 right);
    public static Bool operator>(F32 left, F32 right);
    public static Bool operator <=(F32 left, F32 right);
    public static Bool operator >=(F32 left, F32 right);
    public override bool Equals(object? obj);
    public override int GetHashCode();
    public override string ToString();
}

F32.F32(float value)

public F32(float value);

Initializes a new instance of the Xui.GPU.Shaders.Types.F32 struct.

  • value — The float value.

bool F32.Equals(object? obj)

public override bool Equals(object? obj);

Indicates whether this instance and a specified object are equal.

  • obj — The object to compare with the current instance.

Returns: true if obj and this instance are the same type and represent the same value; otherwise, false.

int F32.GetHashCode()

public override int GetHashCode();

Returns the hash code for this instance.

Returns: A 32-bit signed integer that is the hash code for this instance.

F32 F32.One

public static F32 One { get; }

Gets the one constant.

string F32.ToString()

public override string ToString();

Returns the fully qualified type name of this instance.

Returns: The fully qualified type name.

F32 F32.Zero

public static F32 Zero { get; }

Gets the zero constant.

F32 F32.operator +(F32 left, F32 right)

public static F32 operator +(F32 left, F32 right);

Adds two F32 values.

F32 F32.operator /(F32 left, F32 right)

public static F32 operator /(F32 left, F32 right);

Divides two F32 values.

Bool F32.operator ==(F32 left, F32 right)

public static Bool operator ==(F32 left, F32 right);

Tests equality of two F32 values.

Bool F32.operator >(F32 left, F32 right)

public static Bool operator>(F32 left, F32 right);

Tests if left is greater than right.

Bool F32.operator >=(F32 left, F32 right)

public static Bool operator >=(F32 left, F32 right);

Tests if left is greater than or equal to right.

F32.implicit operator F32(double value)

public static implicit operator F32(double value);

Converts from double to F32 (narrowing).

F32.implicit operator F32(NFloat value)

public static implicit operator F32(nfloat value);

Converts from nfloat to F32.

F32.implicit operator F32(float value)

public static implicit operator F32(float value);

Converts from float to F32.

F32.implicit operator double(F32 value)

public static implicit operator double (F32 value);

Converts from F32 to double.

F32.implicit operator NFloat(F32 value)

public static implicit operator nfloat(F32 value);

Converts from F32 to nfloat.

F32.implicit operator float(F32 value)

public static implicit operator float (F32 value);

Converts from F32 to float.

Bool F32.operator !=(F32 left, F32 right)

public static Bool operator !=(F32 left, F32 right);

Tests inequality of two F32 values.

Bool F32.operator <(F32 left, F32 right)

public static Bool operator <(F32 left, F32 right);

Tests if left is less than right.

Bool F32.operator <=(F32 left, F32 right)

public static Bool operator <=(F32 left, F32 right);

Tests if left is less than or equal to right.

F32 F32.operator *(F32 left, F32 right)

public static F32 operator *(F32 left, F32 right);

Multiplies two F32 values.

F32 F32.operator -(F32 left, F32 right)

public static F32 operator -(F32 left, F32 right);

Subtracts two F32 values.

F32 F32.operator -(F32 value)

public static F32 operator -(F32 value);

Negates an F32 value.

enum FilterMode

Represents texture sampling filter modes.

public enum FilterMode
{
    Point,
    Linear,
}

FilterMode.Linear

Linear

Linear (bilinear) sampling.

FilterMode.Point

Point

Point (nearest neighbor) sampling.

struct Float2

A 2-component vector of 32-bit floats.

public struct Float2
{
    public F32 X;
    public F32 Y;
    public Float2(F32 x, F32 y);
    public Float2(F32 value);
    public static Float2 Zero { get; }
    public static Float2 One { get; }

    public static Float2 operator +(Float2 left, Float2 right);
    public static Float2 operator -(Float2 left, Float2 right);
    public static Float2 operator *(Float2 left, Float2 right);
    public static Float2 operator *(Float2 left, F32 right);
    public static Float2 operator *(F32 left, Float2 right);
    public static Float2 operator /(Float2 left, Float2 right);
    public static Float2 operator /(Float2 left, F32 right);
    public static Float2 operator -(Float2 value);
    public readonly Float2 XX { get; }
    public readonly Float2 XY { get; }
    public readonly Float2 YX { get; }
    public readonly Float2 YY { get; }

    public static implicit operator Float2(Xui.Core.Math2D.Point point);
    public static implicit operator Float2(Xui.Core.Math2D.Vector vector);
    public static implicit operator Float2(Xui.Core.Math2D.Size size);
    public override string ToString();
}

Float2.Float2(F32 value)

public Float2(F32 value);

Initializes a new instance with both components set to the same value.

Float2.Float2(F32 x, F32 y)

public Float2(F32 x, F32 y);

Initializes a new instance of the Xui.GPU.Shaders.Types.Float2 struct.

Float2 Float2.One

public static Float2 One { get; }

Gets the one vector.

string Float2.ToString()

public override string ToString();

Returns the fully qualified type name of this instance.

Returns: The fully qualified type name.

F32 Float2.X

public F32 X;

The X component.

readonly Float2 Float2.XX

public readonly Float2 XX { get; }

Gets the XX swizzle (X, X).

readonly Float2 Float2.XY

public readonly Float2 XY { get; }

Gets the XY swizzle (X, Y).

F32 Float2.Y

public F32 Y;

The Y component.

readonly Float2 Float2.YX

public readonly Float2 YX { get; }

Gets the YX swizzle (Y, X).

readonly Float2 Float2.YY

public readonly Float2 YY { get; }

Gets the YY swizzle (Y, Y).

Float2 Float2.Zero

public static Float2 Zero { get; }

Gets the zero vector.

Float2 Float2.operator +(Float2 left, Float2 right)

public static Float2 operator +(Float2 left, Float2 right);

Adds two vectors.

Float2 Float2.operator /(Float2 left, F32 right)

public static Float2 operator /(Float2 left, F32 right);

Divides a vector by a scalar.

Float2 Float2.operator /(Float2 left, Float2 right)

public static Float2 operator /(Float2 left, Float2 right);

Divides two vectors component-wise.

Float2.implicit operator Float2(Point point)

public static implicit operator Float2(Xui.Core.Math2D.Point point);

Implicitly converts from Xui.Core.Math2D.Point to Xui.GPU.Shaders.Types.Float2.

Float2.implicit operator Float2(Size size)

public static implicit operator Float2(Xui.Core.Math2D.Size size);

Implicitly converts from Xui.Core.Math2D.Size to Xui.GPU.Shaders.Types.Float2.

Float2.implicit operator Float2(Vector vector)

public static implicit operator Float2(Xui.Core.Math2D.Vector vector);

Implicitly converts from Xui.Core.Math2D.Vector to Xui.GPU.Shaders.Types.Float2.

Float2 Float2.operator *(F32 left, Float2 right)

public static Float2 operator *(F32 left, Float2 right);

Multiplies a scalar by a vector.

Float2 Float2.operator *(Float2 left, F32 right)

public static Float2 operator *(Float2 left, F32 right);

Multiplies a vector by a scalar.

Float2 Float2.operator *(Float2 left, Float2 right)

public static Float2 operator *(Float2 left, Float2 right);

Multiplies two vectors component-wise.

Float2 Float2.operator -(Float2 left, Float2 right)

public static Float2 operator -(Float2 left, Float2 right);

Subtracts two vectors.

Float2 Float2.operator -(Float2 value)

public static Float2 operator -(Float2 value);

Negates a vector.

struct Float3

A 3-component vector of 32-bit floats.

public struct Float3
{
    public F32 X;
    public F32 Y;
    public F32 Z;
    public Float3(F32 x, F32 y, F32 z);
    public Float3(F32 value);
    public static Float3 Zero { get; }
    public static Float3 One { get; }

    public static Float3 operator +(Float3 left, Float3 right);
    public static Float3 operator -(Float3 left, Float3 right);
    public static Float3 operator *(Float3 left, Float3 right);
    public static Float3 operator *(Float3 left, F32 right);
    public static Float3 operator *(F32 left, Float3 right);
    public static Float3 operator /(Float3 left, Float3 right);
    public static Float3 operator /(Float3 left, F32 right);
    public static Float3 operator -(Float3 value);
    public static Float3 Cross(Float3 a, Float3 b);
    public static Float3 Normalize(Float3 v);
    public readonly Float2 XY { get; }
    public readonly Float2 XZ { get; }
    public readonly Float2 YX { get; }
    public readonly Float2 YZ { get; }
    public readonly Float2 ZX { get; }
    public readonly Float2 ZY { get; }
    public readonly Float3 XYZ { get; }
    public readonly Float3 XZY { get; }
    public readonly Float3 YXZ { get; }
    public readonly Float3 YZX { get; }
    public readonly Float3 ZXY { get; }
    public readonly Float3 ZYX { get; }

    public override string ToString();
}

Float3.Float3(F32 value)

public Float3(F32 value);

Initializes a new instance with all components set to the same value.

Float3.Float3(F32 x, F32 y, F32 z)

public Float3(F32 x, F32 y, F32 z);

Initializes a new instance of the Xui.GPU.Shaders.Types.Float3 struct.

Float3 Float3.Cross(Float3 a, Float3 b)

public static Float3 Cross(Float3 a, Float3 b);

Computes the cross product of two vectors.

Float3 Float3.Normalize(Float3 v)

public static Float3 Normalize(Float3 v);

Normalizes the vector to unit length.

Float3 Float3.One

public static Float3 One { get; }

Gets the one vector.

string Float3.ToString()

public override string ToString();

Returns the fully qualified type name of this instance.

Returns: The fully qualified type name.

F32 Float3.X

public F32 X;

The X component.

readonly Float2 Float3.XY

public readonly Float2 XY { get; }

Gets the XY swizzle (X, Y).

readonly Float3 Float3.XYZ

public readonly Float3 XYZ { get; }

Gets the XYZ swizzle (X, Y, Z).

readonly Float2 Float3.XZ

public readonly Float2 XZ { get; }

Gets the XZ swizzle (X, Z).

readonly Float3 Float3.XZY

public readonly Float3 XZY { get; }

Gets the XZY swizzle (X, Z, Y).

F32 Float3.Y

public F32 Y;

The Y component.

readonly Float2 Float3.YX

public readonly Float2 YX { get; }

Gets the YX swizzle (Y, X).

readonly Float3 Float3.YXZ

public readonly Float3 YXZ { get; }

Gets the YXZ swizzle (Y, X, Z).

readonly Float2 Float3.YZ

public readonly Float2 YZ { get; }

Gets the YZ swizzle (Y, Z).

readonly Float3 Float3.YZX

public readonly Float3 YZX { get; }

Gets the YZX swizzle (Y, Z, X).

F32 Float3.Z

public F32 Z;

The Z component.

readonly Float2 Float3.ZX

public readonly Float2 ZX { get; }

Gets the ZX swizzle (Z, X).

readonly Float3 Float3.ZXY

public readonly Float3 ZXY { get; }

Gets the ZXY swizzle (Z, X, Y).

readonly Float2 Float3.ZY

public readonly Float2 ZY { get; }

Gets the ZY swizzle (Z, Y).

readonly Float3 Float3.ZYX

public readonly Float3 ZYX { get; }

Gets the ZYX swizzle (Z, Y, X).

Float3 Float3.Zero

public static Float3 Zero { get; }

Gets the zero vector.

Float3 Float3.operator +(Float3 left, Float3 right)

public static Float3 operator +(Float3 left, Float3 right);

Adds two vectors.

Float3 Float3.operator /(Float3 left, F32 right)

public static Float3 operator /(Float3 left, F32 right);

Divides a vector by a scalar.

Float3 Float3.operator /(Float3 left, Float3 right)

public static Float3 operator /(Float3 left, Float3 right);

Divides two vectors component-wise.

Float3 Float3.operator *(F32 left, Float3 right)

public static Float3 operator *(F32 left, Float3 right);

Multiplies a scalar by a vector.

Float3 Float3.operator *(Float3 left, F32 right)

public static Float3 operator *(Float3 left, F32 right);

Multiplies a vector by a scalar.

Float3 Float3.operator *(Float3 left, Float3 right)

public static Float3 operator *(Float3 left, Float3 right);

Multiplies two vectors component-wise.

Float3 Float3.operator -(Float3 left, Float3 right)

public static Float3 operator -(Float3 left, Float3 right);

Subtracts two vectors.

Float3 Float3.operator -(Float3 value)

public static Float3 operator -(Float3 value);

Negates a vector.

struct Float4

A 4-component vector of 32-bit floats.

public struct Float4
{
    public F32 X;
    public F32 Y;
    public F32 Z;
    public F32 W;
    public Float4(F32 x, F32 y, F32 z, F32 w);
    public Float4(Float2 xy, F32 z, F32 w);
    public Float4(Float3 xyz, F32 w);
    public Float4(F32 value);
    public static Float4 Zero { get; }
    public static Float4 One { get; }

    public static Float4 operator +(Float4 left, Float4 right);
    public static Float4 operator -(Float4 left, Float4 right);
    public static Float4 operator *(Float4 left, Float4 right);
    public static Float4 operator *(Float4 left, F32 right);
    public static Float4 operator *(F32 left, Float4 right);
    public static Float4 operator /(Float4 left, Float4 right);
    public static Float4 operator /(Float4 left, F32 right);
    public static Float4 operator -(Float4 value);
    public readonly Float2 XY { get; }
    public readonly Float2 XZ { get; }
    public readonly Float2 XW { get; }
    public readonly Float2 YZ { get; }
    public readonly Float2 YW { get; }
    public readonly Float2 ZW { get; }
    public readonly Float3 XYZ { get; }
    public readonly Float3 XYW { get; }
    public readonly Float3 XZW { get; }
    public readonly Float3 YZW { get; }
    public readonly Float3 RGB { get; }
    public readonly Float4 XYZW { get; }
    public readonly Float4 RGBA { get; }

    public override string ToString();
}

Float4.Float4(F32 value)

public Float4(F32 value);

Initializes a new instance with all components set to the same value.

Float4.Float4(F32 x, F32 y, F32 z, F32 w)

public Float4(F32 x, F32 y, F32 z, F32 w);

Initializes a new instance of the Xui.GPU.Shaders.Types.Float4 struct.

Float4.Float4(Float2 xy, F32 z, F32 w)

public Float4(Float2 xy, F32 z, F32 w);

Initializes a new instance from a Float2 and z, w components.

Float4.Float4(Float3 xyz, F32 w)

public Float4(Float3 xyz, F32 w);

Initializes a new instance from a Float3 and w component.

Float4 Float4.One

public static Float4 One { get; }

Gets the one vector.

readonly Float3 Float4.RGB

public readonly Float3 RGB { get; }

Gets the RGB swizzle (X, Y, Z) - color alias for XYZ.

readonly Float4 Float4.RGBA

public readonly Float4 RGBA { get; }

Gets the RGBA swizzle (X, Y, Z, W) - color alias for XYZW.

string Float4.ToString()

public override string ToString();

Returns the fully qualified type name of this instance.

Returns: The fully qualified type name.

F32 Float4.W

public F32 W;

The W component.

F32 Float4.X

public F32 X;

The X component.

readonly Float2 Float4.XW

public readonly Float2 XW { get; }

Gets the XW swizzle (X, W).

readonly Float2 Float4.XY

public readonly Float2 XY { get; }

Gets the XY swizzle (X, Y).

readonly Float3 Float4.XYW

public readonly Float3 XYW { get; }

Gets the XYW swizzle (X, Y, W).

readonly Float3 Float4.XYZ

public readonly Float3 XYZ { get; }

Gets the XYZ swizzle (X, Y, Z).

readonly Float4 Float4.XYZW

public readonly Float4 XYZW { get; }

Gets the XYZW swizzle (X, Y, Z, W).

readonly Float2 Float4.XZ

public readonly Float2 XZ { get; }

Gets the XZ swizzle (X, Z).

readonly Float3 Float4.XZW

public readonly Float3 XZW { get; }

Gets the XZW swizzle (X, Z, W).

F32 Float4.Y

public F32 Y;

The Y component.

readonly Float2 Float4.YW

public readonly Float2 YW { get; }

Gets the YW swizzle (Y, W).

readonly Float2 Float4.YZ

public readonly Float2 YZ { get; }

Gets the YZ swizzle (Y, Z).

readonly Float3 Float4.YZW

public readonly Float3 YZW { get; }

Gets the YZW swizzle (Y, Z, W).

F32 Float4.Z

public F32 Z;

The Z component.

readonly Float2 Float4.ZW

public readonly Float2 ZW { get; }

Gets the ZW swizzle (Z, W).

Float4 Float4.Zero

public static Float4 Zero { get; }

Gets the zero vector.

Float4 Float4.operator +(Float4 left, Float4 right)

public static Float4 operator +(Float4 left, Float4 right);

Adds two vectors.

Float4 Float4.operator /(Float4 left, F32 right)

public static Float4 operator /(Float4 left, F32 right);

Divides a vector by a scalar.

Float4 Float4.operator /(Float4 left, Float4 right)

public static Float4 operator /(Float4 left, Float4 right);

Divides two vectors component-wise.

Float4 Float4.operator *(F32 left, Float4 right)

public static Float4 operator *(F32 left, Float4 right);

Multiplies a scalar by a vector.

Float4 Float4.operator *(Float4 left, F32 right)

public static Float4 operator *(Float4 left, F32 right);

Multiplies a vector by a scalar.

Float4 Float4.operator *(Float4 left, Float4 right)

public static Float4 operator *(Float4 left, Float4 right);

Multiplies two vectors component-wise.

Float4 Float4.operator -(Float4 left, Float4 right)

public static Float4 operator -(Float4 left, Float4 right);

Subtracts two vectors.

Float4 Float4.operator -(Float4 value)

public static Float4 operator -(Float4 value);

Negates a vector.

struct Float4x4

A 4x4 matrix of 32-bit floats. Used for transformations in shader code.

public struct Float4x4
{
    public Float4 Row0;
    public Float4 Row1;
    public Float4 Row2;
    public Float4 Row3;
    public Float4x4(Float4 row0, Float4 row1, Float4 row2, Float4 row3);
    public static Float4x4 Identity { get; }

    public static Float4 operator *(Float4x4 matrix, Float4 vector);
    public static Float4x4 operator *(Float4x4 left, Float4x4 right);
    public static Float4x4 CreateTranslation(F32 x, F32 y, F32 z);
    public static Float4x4 CreateRotationX(F32 angle);
    public static Float4x4 CreateRotationY(F32 angle);
    public static Float4x4 CreateRotationZ(F32 angle);
    public static Float4x4 CreatePerspective(F32 fovY, F32 aspectRatio, F32 nearPlane, F32 farPlane);
    public static Float4x4 CreateLookAt(Float3 eye, Float3 target, Float3 up);
    public override string ToString();
}

Float4x4.Float4x4(Float4 row0, Float4 row1, Float4 row2, Float4 row3)

public Float4x4(Float4 row0, Float4 row1, Float4 row2, Float4 row3);

Initializes a new instance of the Xui.GPU.Shaders.Types.Float4x4 struct.

Float4x4 Float4x4.CreateLookAt(Float3 eye, Float3 target, Float3 up)

public static Float4x4 CreateLookAt(Float3 eye, Float3 target, Float3 up);

Creates a view matrix (look-at matrix).

Float4x4 Float4x4.CreatePerspective(F32 fovY, F32 aspectRatio, F32 nearPlane, F32 farPlane)

public static Float4x4 CreatePerspective(F32 fovY, F32 aspectRatio, F32 nearPlane, F32 farPlane);

Creates a perspective projection matrix.

  • fovY — Field of view in the Y direction (in radians).

  • aspectRatio — Aspect ratio (width / height).

  • nearPlane — Near clipping plane distance.

  • farPlane — Far clipping plane distance.

This uses a [0, 1] depth range (DirectX/Vulkan style) instead of OpenGL's [-1, 1]. The matrix maps the near plane to NDC Z = 0 and far plane to NDC Z = 1.

Float4x4 Float4x4.CreateRotationX(F32 angle)

public static Float4x4 CreateRotationX(F32 angle);

Creates a rotation matrix around the X axis.

Float4x4 Float4x4.CreateRotationY(F32 angle)

public static Float4x4 CreateRotationY(F32 angle);

Creates a rotation matrix around the Y axis.

Float4x4 Float4x4.CreateRotationZ(F32 angle)

public static Float4x4 CreateRotationZ(F32 angle);

Creates a rotation matrix around the Z axis.

Float4x4 Float4x4.CreateTranslation(F32 x, F32 y, F32 z)

public static Float4x4 CreateTranslation(F32 x, F32 y, F32 z);

Creates a translation matrix.

Float4x4 Float4x4.Identity

public static Float4x4 Identity { get; }

Gets the identity matrix.

Float4 Float4x4.Row0

public Float4 Row0;

First row of the matrix.

Float4 Float4x4.Row1

public Float4 Row1;

Second row of the matrix.

Float4 Float4x4.Row2

public Float4 Row2;

Third row of the matrix.

Float4 Float4x4.Row3

public Float4 Row3;

Fourth row of the matrix.

string Float4x4.ToString()

public override string ToString();

Returns the fully qualified type name of this instance.

Returns: The fully qualified type name.

Float4 Float4x4.operator *(Float4x4 matrix, Float4 vector)

public static Float4 operator *(Float4x4 matrix, Float4 vector);

Multiplies a matrix by a vector.

Float4x4 Float4x4.operator *(Float4x4 left, Float4x4 right)

public static Float4x4 operator *(Float4x4 left, Float4x4 right);

Multiplies two matrices.

readonly struct I32

Shader 32-bit signed integer scalar type.

public readonly struct I32
{
    public I32(int value);
    public static I32 Zero { get; }
    public static I32 One { get; }

    public static implicit operator I32(int value);
    public static implicit operator int (I32 value);
    public static I32 operator +(I32 left, I32 right);
    public static I32 operator -(I32 left, I32 right);
    public static I32 operator *(I32 left, I32 right);
    public static I32 operator /(I32 left, I32 right);
    public static I32 operator -(I32 value);
    public static Bool operator ==(I32 left, I32 right);
    public static Bool operator !=(I32 left, I32 right);
    public static Bool operator <(I32 left, I32 right);
    public static Bool operator>(I32 left, I32 right);
    public static Bool operator <=(I32 left, I32 right);
    public static Bool operator >=(I32 left, I32 right);
    public static I32 operator &(I32 left, I32 right);
    public static I32 operator |(I32 left, I32 right);
    public static I32 operator ^(I32 left, I32 right);
    public static I32 operator ~(I32 value);
    public static I32 operator <<(I32 left, int right);
    public static I32 operator >>(I32 left, int right);
    public override bool Equals(object? obj);
    public override int GetHashCode();
    public override string ToString();
}

I32.I32(int value)

public I32(int value);

Initializes a new instance of the Xui.GPU.Shaders.Types.I32 struct.

  • value — The int value.

bool I32.Equals(object? obj)

public override bool Equals(object? obj);

Indicates whether this instance and a specified object are equal.

  • obj — The object to compare with the current instance.

Returns: true if obj and this instance are the same type and represent the same value; otherwise, false.

int I32.GetHashCode()

public override int GetHashCode();

Returns the hash code for this instance.

Returns: A 32-bit signed integer that is the hash code for this instance.

I32 I32.One

public static I32 One { get; }

Gets the one constant.

string I32.ToString()

public override string ToString();

Returns the fully qualified type name of this instance.

Returns: The fully qualified type name.

I32 I32.Zero

public static I32 Zero { get; }

Gets the zero constant.

I32 I32.operator +(I32 left, I32 right)

public static I32 operator +(I32 left, I32 right);

Adds two I32 values.

I32 I32.operator &(I32 left, I32 right)

public static I32 operator &(I32 left, I32 right);

Performs bitwise AND of two I32 values.

I32 I32.operator |(I32 left, I32 right)

public static I32 operator |(I32 left, I32 right);

Performs bitwise OR of two I32 values.

I32 I32.operator /(I32 left, I32 right)

public static I32 operator /(I32 left, I32 right);

Divides two I32 values.

Bool I32.operator ==(I32 left, I32 right)

public static Bool operator ==(I32 left, I32 right);

Tests equality of two I32 values.

I32 I32.operator ^(I32 left, I32 right)

public static I32 operator ^(I32 left, I32 right);

Performs bitwise XOR of two I32 values.

Bool I32.operator >(I32 left, I32 right)

public static Bool operator>(I32 left, I32 right);

Tests if left is greater than right.

Bool I32.operator >=(I32 left, I32 right)

public static Bool operator >=(I32 left, I32 right);

Tests if left is greater than or equal to right.

I32.implicit operator I32(int value)

public static implicit operator I32(int value);

Converts from int to I32.

I32.implicit operator int(I32 value)

public static implicit operator int (I32 value);

Converts from I32 to int.

Bool I32.operator !=(I32 left, I32 right)

public static Bool operator !=(I32 left, I32 right);

Tests inequality of two I32 values.

I32 I32.operator <<(I32 left, int right)

public static I32 operator <<(I32 left, int right);

Left shifts an I32 value.

Bool I32.operator <(I32 left, I32 right)

public static Bool operator <(I32 left, I32 right);

Tests if left is less than right.

Bool I32.operator <=(I32 left, I32 right)

public static Bool operator <=(I32 left, I32 right);

Tests if left is less than or equal to right.

I32 I32.operator *(I32 left, I32 right)

public static I32 operator *(I32 left, I32 right);

Multiplies two I32 values.

I32 I32.operator ~(I32 value)

public static I32 operator ~(I32 value);

Performs bitwise NOT of an I32 value.

I32 I32.operator >>(I32 left, int right)

public static I32 operator >>(I32 left, int right);

Right shifts an I32 value.

I32 I32.operator -(I32 left, I32 right)

public static I32 operator -(I32 left, I32 right);

Subtracts two I32 values.

I32 I32.operator -(I32 value)

public static I32 operator -(I32 value);

Negates an I32 value.

interface ISampledTexture<TPixel>

CPU implementation of a shader texture resource; pixel storage belongs to the renderer.

  • TPixel — Pixel result type.
public interface ISampledTexture<TPixel>
    where TPixel : unmanaged
{
    TPixel Sample(Sampler sampler, Float2 uv, F32 level);
}

TPixel ISampledTexture<TPixel>.Sample(Sampler sampler, Float2 uv, F32 level)

TPixel Sample(Sampler sampler, Float2 uv, F32 level);

Samples normalized coordinates at an explicit mip level.

struct Int2

A 2-component vector of 32-bit signed integers.

public struct Int2
{
    public I32 X;
    public I32 Y;
    public Int2(I32 x, I32 y);
    public Int2(I32 value);
    public static Int2 Zero { get; }
    public static Int2 One { get; }

    public static Int2 operator +(Int2 left, Int2 right);
    public static Int2 operator -(Int2 left, Int2 right);
    public static Int2 operator *(Int2 left, Int2 right);
    public static Int2 operator *(Int2 left, I32 right);
    public static Int2 operator *(I32 left, Int2 right);
    public static Int2 operator /(Int2 left, Int2 right);
    public static Int2 operator /(Int2 left, I32 right);
    public static Int2 operator -(Int2 value);
    public override string ToString();
}

Int2.Int2(I32 value)

public Int2(I32 value);

Initializes a new instance with both components set to the same value.

Int2.Int2(I32 x, I32 y)

public Int2(I32 x, I32 y);

Initializes a new instance of the Xui.GPU.Shaders.Types.Int2 struct.

Int2 Int2.One

public static Int2 One { get; }

Gets the one vector.

string Int2.ToString()

public override string ToString();

Returns the fully qualified type name of this instance.

Returns: The fully qualified type name.

I32 Int2.X

public I32 X;

The X component.

I32 Int2.Y

public I32 Y;

The Y component.

Int2 Int2.Zero

public static Int2 Zero { get; }

Gets the zero vector.

Int2 Int2.operator +(Int2 left, Int2 right)

public static Int2 operator +(Int2 left, Int2 right);

Adds two vectors.

Int2 Int2.operator /(Int2 left, I32 right)

public static Int2 operator /(Int2 left, I32 right);

Divides a vector by a scalar.

Int2 Int2.operator /(Int2 left, Int2 right)

public static Int2 operator /(Int2 left, Int2 right);

Divides two vectors component-wise.

Int2 Int2.operator *(I32 left, Int2 right)

public static Int2 operator *(I32 left, Int2 right);

Multiplies a scalar by a vector.

Int2 Int2.operator *(Int2 left, I32 right)

public static Int2 operator *(Int2 left, I32 right);

Multiplies a vector by a scalar.

Int2 Int2.operator *(Int2 left, Int2 right)

public static Int2 operator *(Int2 left, Int2 right);

Multiplies two vectors component-wise.

Int2 Int2.operator -(Int2 left, Int2 right)

public static Int2 operator -(Int2 left, Int2 right);

Subtracts two vectors.

Int2 Int2.operator -(Int2 value)

public static Int2 operator -(Int2 value);

Negates a vector.

readonly struct Sampler

Represents a texture sampler that controls how textures are sampled.

Samplers define the filtering and addressing behavior when reading from textures.

public readonly struct Sampler
{
    public FilterMode MinFilter { get; init; }
    public FilterMode MagFilter { get; init; }
    public AddressMode AddressU { get; init; }
    public AddressMode AddressV { get; init; }

    public Sampler(FilterMode minFilter = FilterMode.Linear, FilterMode magFilter = FilterMode.Linear, AddressMode addressU = AddressMode.Repeat, AddressMode addressV = AddressMode.Repeat);
    public static Sampler LinearRepeat { get; }
    public static Sampler LinearClamp { get; }
    public static Sampler PointRepeat { get; }
    public static Sampler PointClamp { get; }
}

Sampler.Sampler(FilterMode minFilter = FilterMode.Linear, FilterMode magFilter = FilterMode.Linear, AddressMode addressU = AddressMode.Repeat, AddressMode addressV = AddressMode.Repeat)

public Sampler(FilterMode minFilter = FilterMode.Linear, FilterMode magFilter = FilterMode.Linear, AddressMode addressU = AddressMode.Repeat, AddressMode addressV = AddressMode.Repeat);

Initializes a new instance of the Xui.GPU.Shaders.Types.Sampler struct.

AddressMode Sampler.AddressU

public AddressMode AddressU { get; init; }

Gets the addressing mode for the U coordinate.

AddressMode Sampler.AddressV

public AddressMode AddressV { get; init; }

Gets the addressing mode for the V coordinate.

Sampler Sampler.LinearClamp

public static Sampler LinearClamp { get; }

Gets a default linear sampler with clamp-to-edge addressing.

Sampler Sampler.LinearRepeat

public static Sampler LinearRepeat { get; }

Gets a default linear sampler with repeat addressing.

FilterMode Sampler.MagFilter

public FilterMode MagFilter { get; init; }

Gets the magnification filter mode.

FilterMode Sampler.MinFilter

public FilterMode MinFilter { get; init; }

Gets the minification filter mode.

Sampler Sampler.PointClamp

public static Sampler PointClamp { get; }

Gets a default point sampler with clamp-to-edge addressing.

Sampler Sampler.PointRepeat

public static Sampler PointRepeat { get; }

Gets a default point sampler with repeat addressing.

readonly struct Texture2D<TPixel>

Represents a 2D texture resource in shader code.

  • TPixel — The pixel format type (typically Color4).

In CPU execution, this wraps actual texture data. In GPU execution, this will be translated to the appropriate backend texture type.

public readonly struct Texture2D<TPixel>
    where TPixel : unmanaged
{
    public Texture2D(object? data);
}

Texture2D<TPixel>.Texture2D(object? data)

public Texture2D(object? data);

Initializes a new instance of the Xui.GPU.Shaders.Types.Texture2D1` struct.

  • data — The underlying texture data (implementation-specific).

readonly struct U32

Shader 32-bit unsigned integer scalar type.

public readonly struct U32
{
    public U32(uint value);
    public static U32 Zero { get; }
    public static U32 One { get; }

    public static implicit operator U32(uint value);
    public static implicit operator uint (U32 value);
    public static U32 operator +(U32 left, U32 right);
    public static U32 operator -(U32 left, U32 right);
    public static U32 operator *(U32 left, U32 right);
    public static U32 operator /(U32 left, U32 right);
    public static Bool operator ==(U32 left, U32 right);
    public static Bool operator !=(U32 left, U32 right);
    public static Bool operator <(U32 left, U32 right);
    public static Bool operator>(U32 left, U32 right);
    public static Bool operator <=(U32 left, U32 right);
    public static Bool operator >=(U32 left, U32 right);
    public static U32 operator &(U32 left, U32 right);
    public static U32 operator |(U32 left, U32 right);
    public static U32 operator ^(U32 left, U32 right);
    public static U32 operator ~(U32 value);
    public static U32 operator <<(U32 left, int right);
    public static U32 operator >>(U32 left, int right);
    public override bool Equals(object? obj);
    public override int GetHashCode();
    public override string ToString();
}

U32.U32(uint value)

public U32(uint value);

Initializes a new instance of the Xui.GPU.Shaders.Types.U32 struct.

  • value — The uint value.

bool U32.Equals(object? obj)

public override bool Equals(object? obj);

Indicates whether this instance and a specified object are equal.

  • obj — The object to compare with the current instance.

Returns: true if obj and this instance are the same type and represent the same value; otherwise, false.

int U32.GetHashCode()

public override int GetHashCode();

Returns the hash code for this instance.

Returns: A 32-bit signed integer that is the hash code for this instance.

U32 U32.One

public static U32 One { get; }

Gets the one constant.

string U32.ToString()

public override string ToString();

Returns the fully qualified type name of this instance.

Returns: The fully qualified type name.

U32 U32.Zero

public static U32 Zero { get; }

Gets the zero constant.

U32 U32.operator +(U32 left, U32 right)

public static U32 operator +(U32 left, U32 right);

Adds two U32 values.

U32 U32.operator &(U32 left, U32 right)

public static U32 operator &(U32 left, U32 right);

Performs bitwise AND of two U32 values.

U32 U32.operator |(U32 left, U32 right)

public static U32 operator |(U32 left, U32 right);

Performs bitwise OR of two U32 values.

U32 U32.operator /(U32 left, U32 right)

public static U32 operator /(U32 left, U32 right);

Divides two U32 values.

Bool U32.operator ==(U32 left, U32 right)

public static Bool operator ==(U32 left, U32 right);

Tests equality of two U32 values.

U32 U32.operator ^(U32 left, U32 right)

public static U32 operator ^(U32 left, U32 right);

Performs bitwise XOR of two U32 values.

Bool U32.operator >(U32 left, U32 right)

public static Bool operator>(U32 left, U32 right);

Tests if left is greater than right.

Bool U32.operator >=(U32 left, U32 right)

public static Bool operator >=(U32 left, U32 right);

Tests if left is greater than or equal to right.

U32.implicit operator U32(uint value)

public static implicit operator U32(uint value);

Converts from uint to U32.

U32.implicit operator uint(U32 value)

public static implicit operator uint (U32 value);

Converts from U32 to uint.

Bool U32.operator !=(U32 left, U32 right)

public static Bool operator !=(U32 left, U32 right);

Tests inequality of two U32 values.

U32 U32.operator <<(U32 left, int right)

public static U32 operator <<(U32 left, int right);

Left shifts a U32 value.

Bool U32.operator <(U32 left, U32 right)

public static Bool operator <(U32 left, U32 right);

Tests if left is less than right.

Bool U32.operator <=(U32 left, U32 right)

public static Bool operator <=(U32 left, U32 right);

Tests if left is less than or equal to right.

U32 U32.operator *(U32 left, U32 right)

public static U32 operator *(U32 left, U32 right);

Multiplies two U32 values.

U32 U32.operator ~(U32 value)

public static U32 operator ~(U32 value);

Performs bitwise NOT of a U32 value.

U32 U32.operator >>(U32 left, int right)

public static U32 operator >>(U32 left, int right);

Right shifts a U32 value.

U32 U32.operator -(U32 left, U32 right)

public static U32 operator -(U32 left, U32 right);

Subtracts two U32 values.