OptionalalphaBase opacity; alphaMode: 'opaque' ignores it
OptionalalphaAlpha below which fragments are discarded when alphaMode is 'mask'
OptionalalphaHow alpha is treated; see AlphaMode
OptionalanisotropyHighlights stretched along one direction; passing the group turns it on
OptionalbaseBase colour tint; the source's alpha is ignored, BaseMaterial3DOptions#alpha sets opacity
OptionalbaseBase colour (albedo) texture
OptionalclearcoatClear lacquer layer on top; passing the group turns it on
OptionaldoubleWhen true, back faces are drawn too and lit with their normal flipped
Fixed at construction.
OptionalemissiveThe material's own glow; passing the group turns it on
Optional AdvancedextraExtra shader bits composed into the material's shader, fixed for its lifetime
Material3D, PhongMaterial and FlatMaterial each document where they sit
in their bit list; on a material built from a raw descriptor, as ToonMaterial and
PortalMaterial are, they follow its bits. A bit may declare material fields and textures;
fill its textures through the textures option, or later through
BaseMaterial3D#textures. A bit that uses PI or INV_PI lists
mathConstantsBit in its ShaderBit#requires rather than declaring them, and one that
calls screenUVFromWorld or sampleScreenCopy lists screenSpaceFuncsBit. To add bits to a
material that exists, such as one the glTF loader built, material.clone({ extraBits }) makes a
copy with them and everything else the material has. For billboarding, set
Mesh3D#billboardMode instead.
OptionalflatWhen true, each triangle is shaded with its face normal instead of the smooth vertex normal
Gives a faceted, low-poly look with no duplicated vertices, so one geometry can draw smooth or faceted depending on its material. A normal map still applies on top. No visible effect on an unlit material such as FlatMaterial. Fixed at construction.
OptionalfogWhether the view's distance fog may reach this material
Turn it off for skyboxes, water and anything else with its own distance falloff; a sky dome past the fog's far distance would turn flat fog colour. Fixed at construction.
OptionaliorIndex of refraction, see Material3D#ior
OptionaliridescenceThin-film colour shift; passing the group turns it on
OptionallabelName for debugging and for finding the material; the glTF loader sets it to the name in the file
OptionalmetallicMetalness, from 0 (non-metal) to 1 (metal)
OptionalmetallicMap with roughness in green and metalness in blue, as in glTF; scales roughness and
metallic
OptionalnormalStrength of the normal map's bumps
OptionalnormalTangent-space normal map, green up as in glTF and OpenGL
Invert the green channel of a DirectX-style map, or its bumps light from the wrong side. Needs UVs
on the geometry, and uses its tangents when it has them. Can be assigned later through
material.textures.normal; a material without one pays nothing for normal mapping.
OptionalocclusionMultiplier on the occlusion, see Material3D#occlusionStrength
OptionalocclusionAmbient occlusion map, read from red; it darkens ambient and environment light only
OptionalpassesExtra render passes this material draws in, keyed by the pass's name
true: draw in the pass with the pass's own shader and state.false, or left out: don't draw in it. Useful for opting out of a pass that spread options
or a subclass default turned on.A material can name a pass before the pass exists. A page has room for 24 custom pass names,
'outline' included, each taken the first time anything names it; a name past that joins
nothing, and a pass with it draws no meshes, without a warning.
OptionalroughnessPerceptual roughness, from 0 (mirror-like) to 1 (fully rough)
OptionalsheenCloth sheen; passing the group turns it on
OptionalspecularStrength and tint of non-metal reflections; passing the group turns it on
Optional AdvancedtexturesTextures by slot name, for the slots a descriptor or extraBits declares
The bits' textures arrays decide which slots exist; this map only fills them. A slot left out
gets Texture.WHITE. A baseColor entry here wins over
BaseMaterial3DOptions#baseColorTexture.
OptionaltopologyPrimitive topology for every pass that doesn't set its own; left out, the geometry's is used
'line-list' joins the indices in pairs, so a triangle index buffer drawn that way isn't a
wireframe: it draws some edges and misses others. Use a geometry with line indices for that.
OptionaltransmissionGlass and other see-through surfaces; passing the group turns it on
OptionaluvUV transform for every texture of the material; see BaseMaterial3D#uvTransform
Leave it out to let a framed (spritesheet) base colour texture set the transform.
OptionalvertexWhether a geometry's vertex colours (its colors) tint this material; see
BaseMaterial3D#vertexColors
Options for Material3D
Each extension (
emissive,specular,iridescence,transmission,clearcoat,sheen,anisotropy) is a group that turns the feature on when passed, even empty:clearcoat: {}adds a full-strength coat. Inside a group, each factor and strength defaults to 1 and each colour to white; the glTF loader passes each extension's own defaults instead.Example