gpu-curtains
    Preparing search index...

    Parameters used to build a lit fragment shader.

    interface FragmentShaderInputParams {
        toneMapping?: ToneMappings;
        outputColorSpace?: ColorSpace;
        additionalVaryings?: { type: string; name: string }[];
        fragmentOutput?: FragmentOutput;
        chunks?: AdditionalChunks;
        geometry: Geometry;
        materialUniform?: BufferBindingBaseParams;
        materialUniformName?: string;
        receiveShadows?: boolean;
        cullMode?: GPUCullMode;
        flatShading?: boolean;
        extensionsUsed?: GLTFExtensionsUsed;
        environmentMap?: EnvironmentMap;
        transmissiveInputColorSpace?: ColorSpace;
        transmissiveInputToneMapping?: ToneMappings;
        shadingModel?: ShadingModels;
        baseColorTexture?: ShaderTextureDescriptor;
        emissiveTexture?: ShaderTextureDescriptor;
        occlusionTexture?: ShaderTextureDescriptor;
        normalTexture?: ShaderTextureDescriptor;
        metallicRoughnessTexture?: ShaderTextureDescriptor;
        specularTexture?: ShaderTextureDescriptor;
        specularFactorTexture?: ShaderTextureDescriptor;
        specularColorTexture?: ShaderTextureDescriptor;
        transmissionThicknessTexture?: ShaderTextureDescriptor;
        transmissionTexture?: ShaderTextureDescriptor;
        thicknessTexture?: ShaderTextureDescriptor;
        transmissionBackgroundTexture?: ShaderTextureDescriptor;
        sheenTexture?: ShaderTextureDescriptor;
        sheenColorTexture?: ShaderTextureDescriptor;
        sheenRoughnessTexture?: ShaderTextureDescriptor;
        anisotropyTexture?: ShaderTextureDescriptor;
        clearcoatTexture?: ShaderTextureDescriptor;
        clearcoatFactorTexture?: ShaderTextureDescriptor;
        clearcoatRoughnessTexture?: ShaderTextureDescriptor;
        clearcoatNormalTexture?: ShaderTextureDescriptor;
        iridescenceTexture?: ShaderTextureDescriptor;
        iridescenceFactorTexture?: ShaderTextureDescriptor;
        iridescenceThicknessTexture?: ShaderTextureDescriptor;
        diffuseTransmissionTexture?: ShaderTextureDescriptor;
        diffuseTransmissionFactorTexture?: ShaderTextureDescriptor;
        diffuseTransmissionColorTexture?: ShaderTextureDescriptor;
    }

    Hierarchy (View Summary)

    Index

    Properties

    toneMapping?: ToneMappings

    Whether the shading function should apply tone mapping to the resulting color and if so, which one. Default to 'Khronos'.

    outputColorSpace?: ColorSpace

    In which ColorSpace the output should be done. srgb should be used most of the time, except for some post processing effects that need input colors in linear space (such as bloom). Default to srgb.

    additionalVaryings?: { type: string; name: string }[]

    Optional additional varyings to pass from the vertex shader to the fragment shader.

    Type Declaration

    • type: string

      type of the varying.

    • name: string

      name of the varying.

    fragmentOutput?: FragmentOutput

    Custom fragment shader output structure members and returned values to use if needed. Useful when rendering to a Multiple Render Target for example.

    Additional WGSL chunks to add to the shaders.

    geometry: Geometry

    Geometry used to create the fragment shader. Can use the vertexBuffers properties for vertex colors or tangent/bitangent computations.

    materialUniform?: BufferBindingBaseParams

    The BufferBindingBaseParams holding the material uniform values. Will use default values if not provided.

    materialUniformName?: string

    The BufferBindingBaseParams name to use for variables declarations. Default to 'material'.

    receiveShadows?: boolean

    Whether the shading function should account for current shadows. Default to false.

    cullMode?: GPUCullMode

    Culling mode to use for normal and tangent calculations. Default to back.

    flatShading?: boolean

    Whether the material should be rendered using flat shading. Default to false.

    extensionsUsed?: GLTFExtensionsUsed

    The glTF extensions used to generate this fragment shader.

    environmentMap?: EnvironmentMap

    EnvironmentMap to use for IBL shading.

    transmissiveInputColorSpace?: ColorSpace

    Whether the opaque objects sampled by the transmission texture have been drawn in linear or srgb color space. Default to srgb.

    transmissiveInputToneMapping?: ToneMappings

    The tone mapping applied to the opaque objects sampled by the transmission texture, if any. Default to Khronos.

    shadingModel?: ShadingModels

    Shading model to use. Default to 'PBR'.

    baseColorTexture?: ShaderTextureDescriptor

    Base color texture descriptor to use if any. Format should be rgba8unorm-srgb.

    emissiveTexture?: ShaderTextureDescriptor

    Emissive texture descriptor to use if any. Format should be rgba8unorm-srgb.

    occlusionTexture?: ShaderTextureDescriptor

    Occlusion texture descriptor to use if any. Format must be at least r8unorm.

    normalTexture?: ShaderTextureDescriptor

    Normal texture descriptor to use if any. Format should be rgba8unorm.

    metallicRoughnessTexture?: ShaderTextureDescriptor

    Metallic roughness texture descriptor to use if any. Format should be rgba8unorm.

    specularTexture?: ShaderTextureDescriptor

    Specular texture descriptor (mixing both specular color in the RGB channels and specular intensity in the A channel) to use if any. Format should be rgba8unorm-srgb.

    specularFactorTexture?: ShaderTextureDescriptor

    Specular intensity texture descriptor (using the A channel) to use if any. Format should be rgba8unorm-srgb or rgba8unorm.

    specularColorTexture?: ShaderTextureDescriptor

    Specular color texture descriptor (using the RGB channels) to use if any. Format should be rgba8unorm-srgb.

    transmissionThicknessTexture?: ShaderTextureDescriptor

    Transmission thickness texture descriptor (using the R channel for transmission and the G channel for thickness) to use if any. Format must be at least rg8unorm.

    transmissionTexture?: ShaderTextureDescriptor

    Transmission texture descriptor (using the R channel) to use if any. Format must be at least r8unorm.

    thicknessTexture?: ShaderTextureDescriptor

    Thickness texture descriptor (using the G channel) to use if any. Format must be at least rg8unorm.

    transmissionBackgroundTexture?: ShaderTextureDescriptor

    Transmission scene background texture descriptor to use if any. Handled internally by the renderer.

    Sheen texture descriptor (mixing both sheen color in the RGB channels and roughness in the A channel) to use if any. Format should be rgba8unorm-srgb.

    sheenColorTexture?: ShaderTextureDescriptor

    Sheen color texture descriptor (using the RGB channels) to use if any. Format should be rgba8unorm-srgb.

    sheenRoughnessTexture?: ShaderTextureDescriptor

    Sheen roughness texture descriptor (using the A channel) to use if any. Format should be rgba8unorm-srgb or rgba8unorm.

    anisotropyTexture?: ShaderTextureDescriptor

    Anisotropy texture descriptor to use if any. Format should be rgba8unorm.

    clearcoatTexture?: ShaderTextureDescriptor

    Clearcoat texture descriptor (mixing both clearcoat factor in the R channel and roughness in the G channel) to use if any. Format must be at least rg8unorm.

    clearcoatFactorTexture?: ShaderTextureDescriptor

    Clearcoat factor texture descriptor (using the R channel) to use if any. Format must be at least r8unorm.

    clearcoatRoughnessTexture?: ShaderTextureDescriptor

    Clearcoat roughness texture descriptor (using the G channel) to use if any. Format must be at least rg8unorm.

    clearcoatNormalTexture?: ShaderTextureDescriptor

    Clearcoat normal texture descriptor to use if any. Format should be rgba8unorm.

    iridescenceTexture?: ShaderTextureDescriptor

    Iridescence texture descriptor (using the R channel for intensity and G channel for thickness) to use if any. Format must be at least rg8unorm.

    iridescenceFactorTexture?: ShaderTextureDescriptor

    Iridescence texture descriptor (using the R channel) to use if any. Format must be at least r8unorm.

    iridescenceThicknessTexture?: ShaderTextureDescriptor

    Iridescence thickness texture descriptor (using the G channel) to use if any. Format must be at least rg8unorm.

    diffuseTransmissionTexture?: ShaderTextureDescriptor

    Diffuse transmission texture descriptor (using the RGB channels for color and A channel for intensity) to use if any. Format should be rgba8unorm-srgb.

    diffuseTransmissionFactorTexture?: ShaderTextureDescriptor

    Diffuse transmission intensity texture descriptor (using the A channel) to use if any. Format should be rgba8unorm-srgb or rgba8unorm.

    diffuseTransmissionColorTexture?: ShaderTextureDescriptor

    Diffuse transmission texture descriptor (using the RGB channels) to use if any. Format should be rgba8unorm-srgb.