API reference
Preparing search index…

Native-owned program; source loading and compilation run asynchronously.

Source & inheritance
Member directory15

Constructors

Properties

Accessors

Methods

Constructors

Properties

CurrentTexture: typeof CurrentTexture = ...

Texture uniform placeholder using the texture bound to the current object at draw time.

Source & inheritance
Type: typeof ShaderType = ShaderType

Shader stage enumeration.

Source & inheritance

Methods

  • Returns the OpenGL program identifier, or 0 if compilation has not succeeded.

    Returns

    number
    Source & inheritance
  • Compiles files asynchronously; accepts a file and stage, vertex/fragment files, or vertex/geometry/fragment files.

    Parameters

    ...sources
    Sources<string>

    Returns

    Promise<boolean>
    Source & inheritance
  • Compiles GLSL source asynchronously; argument order matches loadFromFile. Returns whether compilation and linking succeeded.

    Parameters

    ...sources
    Sources<string>

    Returns

    Promise<boolean>
    Source & inheritance
  • Reads UTF-8 GLSL from input streams and compiles asynchronously; stage order matches loadFromFile.

    Parameters

    ...sources
    Sources<InputStream>

    Returns

    Promise<boolean>
    Source & inheritance
  • Sets a uniform; number defaults to float. Texture arguments retain references; other values are copied synchronously.

    Parameters

    name
    string
    value
    Uniform

    Returns

    void
    Source & inheritance
  • Sets a numeric uniform explicitly as GLSL float or int, first submitting recorded draws.

    Parameters

    name
    string
    value
    number
    type
    "float" | "int"

    Returns

    void
    Source & inheritance
  • Synchronously uploads a homogeneous array of floats, floating-point vectors or matrices, first submitting recorded draws.

    Parameters

    name
    string
    values
    Float32Array | readonly ArrayElement[]

    Returns

    void
    Source & inheritance
  • Binds a program for direct OpenGL operations; null unbinds it.

    Parameters

    shader

        | null
        | Readonly<
            Pick<
                Shader,
                | typeof graphicsNative
                | "getNativeHandle"
                | typeof shaderId
                | typeof shaderTextures,
            >,
        >

    Returns

    void
    Source & inheritance
  • Returns whether the current environment supports shaders.

    Returns

    boolean
    Source & inheritance
  • Returns whether the current environment supports geometry shaders.

    Returns

    boolean
    Source & inheritance

Symbol members

"[graphicsNative]": NativeGraphicsHandle<"shader">
Source & inheritance
"[shaderId]": number
Source & inheritance
  • get "[shaderTextures]"(): ReadonlyMap<
        number,
        Readonly<
            Pick<
                Texture,
                | "getSize"
                | typeof graphicsNative
                | typeof textureId
                | typeof textureOwner
                | "copyToImage"
                | "isSmooth"
                | "isRepeated"
                | "isSrgb"
                | "getNativeHandle",
            >,
        >,
    >

    Returns

    ReadonlyMap<
        number,
        Readonly<
            Pick<
                Texture,
                | "getSize"
                | typeof graphicsNative
                | typeof textureId
                | typeof textureOwner
                | "copyToImage"
                | "isSmooth"
                | "isRepeated"
                | "isSrgb"
                | "getNativeHandle",
            >,
        >,
    >
    Source & inheritance

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0