Parameters used to build the shaders

interface ShaderBuilderParameters {
    shadingModel?: ShadingModels;
    chunks?: {
        additionalFragmentHead?: string;
        preliminaryColorContribution?: string;
        additionalColorContribution?: string;
    };
    iblParameters?: {
        diffuseStrength?: number;
        specularStrength?: number;
        environmentMap?: EnvironmentMap;
    };
}

Properties

shadingModel?: ShadingModels

Shading model to use.

chunks?: {
    additionalFragmentHead?: string;
    preliminaryColorContribution?: string;
    additionalColorContribution?: string;
}

Additional WGSL chunks to add to the shaders.

Type declaration

  • Optional additionalFragmentHead?: string

    Additional WGSL chunk to add to the fragment shader head.

  • Optional preliminaryColorContribution?: string

    Preliminary modification to apply to the fragment shader color vec4f variable before applying any lightning calculations.

  • Optional additionalColorContribution?: string

    Additional modification to apply to the fragment shader color vec4f variable before returning it.

iblParameters?: {
    diffuseStrength?: number;
    specularStrength?: number;
    environmentMap?: EnvironmentMap;
}

Additional IBL parameters to pass as uniform and textures.

Type declaration

  • Optional diffuseStrength?: number

    Environment diffuse strength. Default to 0.5.

  • Optional specularStrength?: number

    Environment specular strength. Default to 0.5.

  • Optional environmentMap?: EnvironmentMap

    EnvironmentMap to use for IBL shading.