Small World Engine API Reference - v0.76.20
    Preparing search index...

    Class CustomShaderMaterial

    A highly flexible material that allows developers to write entirely custom shader code (WGSL and GLSL) without modifying the core engine chunks. Perfect for very specific visual effects.

    Hierarchy (View Summary)

    Index
    _renderManifest: RenderManifest | undefined = undefined

    Cached render manifest to avoid frequent allocations.

    color: Color = Color.WHITE

    The base color of the material.

    cullMode: CullMode = CullMode.DEFAULT

    The culling mode for this material. Defaults to BACK.

    depthTest: boolean = true

    Whether the material performs depth testing. Defaults to true.

    depthWrite: boolean = true

    Whether the material writes to the depth buffer. Defaults to true.

    layout: ShaderLayout
    properties: Record<string, unknown>
    sources: {
        glsl100?: { fs: string; vs: string };
        glsl300?: { fs: string; vs: string };
        wgsl?: string;
    }
    textures: Record<string, Texture | CubeTexture | undefined>
    transparent: boolean = false

    Whether the material is transparent. Defaults to false.

    type: string

    The type of the material.

    uuid: string = ...

    The unique identifier of the material.

    • Helper to synchronize texture offset and repeat from a given texture.

      Parameters

      • tex:
            | { offset: { x: number; y: number }; repeat: { x: number; y: number } }
            | undefined

      Returns void