OptionaltoneWhether the shading function should apply tone mapping to the resulting color and if so, which one. Default to 'Khronos'.
OptionaloutputIn 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.
OptionaladditionalOptional additional varyings to pass from the vertex shader to the fragment shader.
OptionalfragmentCustom fragment shader output structure members and returned values to use if needed. Useful when rendering to a Multiple Render Target for example.
OptionalchunksAdditional WGSL chunks to add to the shaders.
Geometry used to create the fragment shader. Can use the vertexBuffers properties for vertex colors or tangent/bitangent computations.
OptionalmaterialThe BufferBindingBaseParams holding the material uniform values. Will use default values if not provided.
OptionalmaterialThe BufferBindingBaseParams name to use for variables declarations. Default to 'material'.
OptionalreceiveWhether the shading function should account for current shadows. Default to false.
OptionalcullCulling mode to use for normal and tangent calculations. Default to back.
OptionalflatWhether the material should be rendered using flat shading. Default to false.
OptionalextensionsThe glTF extensions used to generate this fragment shader.
OptionalenvironmentEnvironmentMap to use for IBL shading.
OptionaltransmissiveWhether the opaque objects sampled by the transmission texture have been drawn in linear or srgb color space. Default to srgb.
OptionaltransmissiveThe tone mapping applied to the opaque objects sampled by the transmission texture, if any. Default to Khronos.
OptionalshadingShading model to use. Default to 'PBR'.
OptionalbaseBase color texture descriptor to use if any. Format should be rgba8unorm-srgb.
OptionalemissiveEmissive texture descriptor to use if any. Format should be rgba8unorm-srgb.
OptionalocclusionOcclusion texture descriptor to use if any. Format must be at least r8unorm.
OptionalnormalNormal texture descriptor to use if any. Format should be rgba8unorm.
OptionalmetallicMetallic roughness texture descriptor to use if any. Format should be rgba8unorm.
OptionalspecularSpecular 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.
OptionalspecularSpecular intensity texture descriptor (using the A channel) to use if any. Format should be rgba8unorm-srgb or rgba8unorm.
OptionalspecularSpecular color texture descriptor (using the RGB channels) to use if any. Format should be rgba8unorm-srgb.
OptionaltransmissionTransmission 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.
OptionaltransmissionTransmission texture descriptor (using the R channel) to use if any. Format must be at least r8unorm.
OptionalthicknessThickness texture descriptor (using the G channel) to use if any. Format must be at least rg8unorm.
OptionaltransmissionTransmission scene background texture descriptor to use if any. Handled internally by the renderer.
OptionalsheenSheen 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.
OptionalsheenSheen color texture descriptor (using the RGB channels) to use if any. Format should be rgba8unorm-srgb.
OptionalsheenSheen roughness texture descriptor (using the A channel) to use if any. Format should be rgba8unorm-srgb or rgba8unorm.
OptionalanisotropyAnisotropy texture descriptor to use if any. Format should be rgba8unorm.
OptionalclearcoatClearcoat 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.
OptionalclearcoatClearcoat factor texture descriptor (using the R channel) to use if any. Format must be at least r8unorm.
OptionalclearcoatClearcoat roughness texture descriptor (using the G channel) to use if any. Format must be at least rg8unorm.
OptionalclearcoatClearcoat normal texture descriptor to use if any. Format should be rgba8unorm.
OptionaliridescenceIridescence texture descriptor (using the R channel for intensity and G channel for thickness) to use if any. Format must be at least rg8unorm.
OptionaliridescenceIridescence texture descriptor (using the R channel) to use if any. Format must be at least r8unorm.
OptionaliridescenceIridescence thickness texture descriptor (using the G channel) to use if any. Format must be at least rg8unorm.
OptionaldiffuseDiffuse transmission texture descriptor (using the RGB channels for color and A channel for intensity) to use if any. Format should be rgba8unorm-srgb.
OptionaldiffuseDiffuse transmission intensity texture descriptor (using the A channel) to use if any. Format should be rgba8unorm-srgb or rgba8unorm.
OptionaldiffuseDiffuse transmission texture descriptor (using the RGB channels) to use if any. Format should be rgba8unorm-srgb.
Parameters used to build a lit fragment shader.