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

    Interface CustomShaderMaterialOptions

    interface CustomShaderMaterialOptions {
        cullMode?: CullMode;
        depthTest?: boolean;
        depthWrite?: boolean;
        layout: ShaderLayout;
        properties?: Record<string, unknown>;
        sources: {
            glsl100?: { fs: string; vs: string };
            glsl300?: { fs: string; vs: string };
            wgsl?: string;
        };
        textures?: Record<string, CubeTexture | Texture | undefined>;
        transparent?: boolean;
    }
    Index
    cullMode?: CullMode

    The culling mode. Defaults to BACK.

    depthTest?: boolean

    Whether the material performs depth testing. Defaults to true.

    depthWrite?: boolean

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

    layout: ShaderLayout

    The uniform and texture layout expected by this custom shader.

    properties?: Record<string, unknown>

    Initial uniform property values mapped to names defined in the layout.

    sources: {
        glsl100?: { fs: string; vs: string };
        glsl300?: { fs: string; vs: string };
        wgsl?: string;
    }

    Shader sources for different APIs. Provide at least one matching the active renderer.

    textures?: Record<string, CubeTexture | Texture | undefined>

    Initial textures mapped to names defined in the layout.

    transparent?: boolean

    Whether the material is transparent. Defaults to false.