gpu-curtains
    Preparing search index...

    Interface LitMeshMaterialParams

    Define the material parameters of a LitMesh.

    interface LitMeshMaterialParams {
        toneMapping?: ToneMappings;
        outputColorSpace?: ColorSpace;
        additionalVaryings?: { type: string; name: string }[];
        cullMode?: GPUCullMode;
        flatShading?: boolean;
        environmentMap?: EnvironmentMap;
        transmissiveInputColorSpace?: ColorSpace;
        transmissiveInputToneMapping?: ToneMappings;
        colorSpace?: ColorSpace;
        color?: Vec3;
        opacity?: number;
        alphaCutoff?: number;
        metallic?: number;
        roughness?: number;
        normalScale?: Vec2;
        occlusionIntensity?: number;
        emissiveIntensity?: number;
        emissiveColor?: Vec3;
        specularIntensity?: number;
        specularColor?: Vec3;
        shininess?: number;
        transmission?: number;
        ior?: number;
        dispersion?: number;
        thickness?: number;
        attenuationDistance?: number;
        attenuationColor?: Vec3;
        multiscatterColor?: Vec3;
        scatterAnisotropy?: number;
        sheenColor?: Vec3;
        sheenRoughness?: number;
        anisotropy?: number;
        anisotropyVector?: Vec2;
        clearcoat?: number;
        clearcoatRoughness?: number;
        clearcoatNormalScale?: Vec2;
        iridescence?: number;
        iridescenceIOR?: number;
        iridescenceThicknessRange?: Vec2;
        diffuseTransmission?: number;
        diffuseTransmissionColor?: Vec3;
        baseColorTexture?: ShaderTextureDescriptor;
        emissiveTexture?: ShaderTextureDescriptor;
        occlusionTexture?: ShaderTextureDescriptor;
        normalTexture?: ShaderTextureDescriptor;
        metallicRoughnessTexture?: ShaderTextureDescriptor;
        specularTexture?: ShaderTextureDescriptor;
        specularFactorTexture?: ShaderTextureDescriptor;
        specularColorTexture?: ShaderTextureDescriptor;
        transmissionThicknessTexture?: ShaderTextureDescriptor;
        transmissionTexture?: ShaderTextureDescriptor;
        thicknessTexture?: 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;
        shading?: ShadingModels;
        vertexChunks?: AdditionalChunks;
        fragmentChunks?: AdditionalChunks;
        fragmentOutput?: FragmentOutput;
    }

    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.

    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.

    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.

    colorSpace?: ColorSpace

    ColorSpace to use for material uniform colors. All lighting calculations must be done in linear space. Default to srgb (which means the uniform colors are converted to linear space), but glTF internally use linear.

    color?: Vec3

    Base color of the LitMesh as a Vec3. Default to new Vec3(1).

    opacity?: number

    Opacity of the LitMesh. If different than 1, consider setting the transparent parameter to true. Default to 1.

    alphaCutoff?: number

    Alpha cutoff threshold value of the LitMesh. Default to 0.5.

    metallic?: number

    The metallic factor of the LitMesh. Default to 1.

    roughness?: number

    The roughness factor of the LitMesh. Default to 1.

    normalScale?: Vec2

    How much the normal map affects the material normal texture if any. Typical ranges are [0-1]. Default to new Vec2(1).

    occlusionIntensity?: number

    A scalar multiplier controlling the amount of occlusion applied to the occlusion texture if any. Default to 1.

    emissiveIntensity?: number

    Emissive intensity to apply to the emissive color of the LitMesh. Default to 1.

    emissiveColor?: Vec3

    Emissive color of the LitMesh as a Vec3. Default to new Vec3(0) (no emissive color).

    specularIntensity?: number

    The strength of the specular reflections applied to the LitMesh (not applicable to Lambert shading). Default to 1.

    specularColor?: Vec3

    Specular color to use for the specular reflections of the LitMesh as a Vec3 (not applicable to Lambert shading). Default to new Vec3(1).

    shininess?: number

    Shininess of the LitMesh when using Phong shading. Default to 30.

    transmission?: number

    The base percentage of light that is transmitted through the surface of the LitMesh. Only applicable to PBR shading if transmissive parameter is set to true. Default to 0.

    ior?: number

    The index of refraction of the LitMesh. Default to 1.5.

    dispersion?: number

    The strength of the dispersion effect, specified as 20/Abbe number. Only applicable to PBR shading if transmissive parameter is set to true. Default to 0.

    thickness?: number

    The thickness of the volume beneath the surface. The value is given in the coordinate space of the mesh. If the value is 0 the material is thin-walled. Only applicable to PBR shading if transmissive parameter is set to true. Default to 0.

    attenuationDistance?: number

    Density of the medium given as the average distance that light travels in the medium before interacting with a particle. The value is given in world space. Only applicable to PBR shading if transmissive parameter is set to true. Default to Infinity.

    attenuationColor?: Vec3

    The color as a Vec3 that white light turns into due to absorption when reaching the attenuation distance. Only applicable to PBR shading if transmissive parameter is set to true. Default to new Vec3(1).

    multiscatterColor?: Vec3

    The multi-scatter albedo. Default to new Vec3(0).

    scatterAnisotropy?: number

    The anisotropy of scatter events. Range is (-1, 1). Default to 0.

    sheenColor?: Vec3

    Sheen color to use. Default to new Vec3(0), but sheen is not taken into account if this and sheenRoughness are not set.

    sheenRoughness?: number

    Sheen roughness to use. Default to 0, but sheen is not taken into account if this and sheenColor are not set.

    anisotropy?: number

    Anisotropy strength. Default to 0, but anisotropy is not taken into account if not set or equal to 0.

    anisotropyVector?: Vec2

    Anisotropy vector based on a rotation value, where x component is cos(rotation) and y component is sin(rotation). Default to new Vec2(1, 0).

    clearcoat?: number

    Clearcoat layer intensity. Default to 0, but clearcoat is not taken into account if not set or equal to 0.

    clearcoatRoughness?: number

    Clearcoat layer roughness. Default to 0.

    clearcoatNormalScale?: Vec2

    Clearcoat normal map scale if any clearcoat normal texture is defined. Default to new Vec2(1).

    iridescence?: number

    Iridescence intensity factor. Default to 0, but iridescence is not taken into account if not set or equal to 0.

    iridescenceIOR?: number

    Index of refraction of the dielectric thin-film layer. Default to 1.3.

    iridescenceThicknessRange?: Vec2

    Minimum and maximum thickness of the iridescence layer. Default to new Vec2(100, 400).

    diffuseTransmission?: number

    The percentage of non-specularly reflected light that is diffusely transmitted through the surface. Default to 0.

    diffuseTransmissionColor?: Vec3

    The color that modulates the transmitted light. Default to new Vec3(1).

    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.

    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.

    shading?: ShadingModels

    ShadingModels to use for lighting. Default to PBR.

    vertexChunks?: AdditionalChunks

    Additional WGSL chunks to add to the vertex shaders.

    fragmentChunks?: AdditionalChunks

    Additional WGSL chunks to add to the fragment shaders.

    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.