<sk-plain-material>

← prev index next →

Defines how a solid surface looks — a base color, plus how that color responds to light and space — as a reusable resource many objects can share.

Remarks

This is the member of the Material family: like every material it is a reusable, standalone definition of a surface's appearance, referenced by the paints that apply it; here it gives a solid surface a base color enriched by an optional tonemap, color-source, and field. Because the material is shared by id, animating it updates every object that references it at once.

Key attributes. base-color is the flat surface color. tonemap references a sk-tonemap that recolors the surface by light (shadow-to-light hues); base-color-source references a ColorSource that varies the base color by space. base-color-darken-factor controls how much shadows darken when no tonemap is present. field is an optional spatial mask for per-fragment alpha — a scene-resident field, shareable with other consumers so one <sk-animation> on it drives them all together. When a tonemap and a color-source are present, tonemap-blend-mode (default multiply, so the tonemap tints the base color) and base-color-source-blend-mode (default normal, so the source defines the base color where it applies) choose how each composites over the base, and color-interpolation selects the space that blending happens in.

Related. It is put on an object by the Paint family — sk-surface-paint, sk-edge-paint, sk-stroke-paint — which name it with material="#id". Its color inputs are a sk-tonemap (by light) and a sk-color-map-source or other ColorSource (by space).

Serve these docs to run the live example. WebGPU needs a secure context — open this page via grunt serve rather than double-clicking the file. The Markup tab works from disk.

Attributes

AttributeTypeDefaultDescription
id <id> The element's unique identifier — the standard HTML global id attribute.
base-coloranimatable <color> The base surface color.
base-color-darken-factoranimatable <number> Controls how much the base color darkens in shadow when no tonemap is provided.
tonemapanimatable <id-ref> Optional tonemap that defines the lighting response. reference by id
tonemap-blend-modeanimatable <blend-mode> ("normal" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "color-dodge" | "color-burn" | "hard-light" | "soft-light" | "difference" | "exclusion" | "hue" | "saturation" | "color" | "luminosity" | "plus-lighter") "multiply" CSS blend mode for combining the tonemap output with baseColor.
base-color-sourceanimatable <id-ref> Gets the base-color-source, resolving a source-less material to the reference by id
base-color-source-blend-modeanimatable <blend-mode> ("normal" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "color-dodge" | "color-burn" | "hard-light" | "soft-light" | "difference" | "exclusion" | "hue" | "saturation" | "color" | "luminosity" | "plus-lighter") "normal" The blend mode used when a baseColorSource composites over the flat
color-interpolation <blend-color-interpolation> ("auto" | "srgb" | "srgb-linear") "auto" The color space this material's compositing blends run in — the
backdrop-blend-modeanimatable <backdrop-blend-mode> ("normal" | "multiply" | "screen" | "plus-lighter") "normal" How this material's final RGBA blends across the material↔BACKDROP
fieldanimatable <id-ref> Optional field that controls fragment alpha (opacity masking). reference by id

Children

Optional tonemap child referencing a color-map (ramp / ordered-dither / blue-noise / halftone / composite).