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

    Interface ShaderDefinition

    Defines a shader for all supported APIs.

    interface ShaderDefinition {
        defaultState?: {
            blending?: BlendingMode;
            culling?: CullMode;
            depthTest?: boolean;
            depthWrite?: boolean;
            transparent?: boolean;
        };
        id: string;
        layout: ShaderLayout;
        sources: {
            glsl100?: { fs: string; vs: string };
            glsl300?: { fs: string; vs: string };
            wgsl?: string;
        };
    }
    Index

    Properties

    defaultState?: {
        blending?: BlendingMode;
        culling?: CullMode;
        depthTest?: boolean;
        depthWrite?: boolean;
        transparent?: boolean;
    }

    Optional default state for the GPU pipeline.

    id: string

    Unique ID of the shader.

    layout: ShaderLayout

    The data layout expected by this shader.

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

    Shader sources for different APIs.