matte
A soft opaque surface: half-lambert diffuse, a sky ambient, one broad highlight. Reads well on white.
Add the script once, then use the tags anywhere.
<script type="module" src="https://mmaxence.github.io/solids/solids.js"></script>
Or copy the library into your project: download solids.js from the repo and serve it yourself. No build step, no other files.
Options
| Attribute | Type | Default | Range | Description |
|---|---|---|---|---|
matte-light | number | 120 | 0 to 360 | Light azimuth (degrees) |
matte-softness | number | 0.5 | 0 to 1 | Terminator softness |
Notes
An opaque, softly lit surface. Diffuse light wraps around the shape with a firm terminator, a faint sky light comes from above, and one broad highlight sits where the key light reflects. On a light background the edges darken slightly so the silhouette holds; on a dark one a faint rim keeps it off black.
light(0 to 360, default 120): where the key light comes from, around the view. 0 is from the right, 90 from the top.softness(0 to 1, default 0.5): how far the light wraps past the terminator.
<sd-scene shading="matte" matte-light="300">
<sd-knot color="color(display-p3 0.78 0.66 1)"></sd-knot>
</sd-scene>Put shading="matte" on a scene to shade every object in it, or on one object. Compare all shades on the Shades page.
License
MIT. Use it anywhere, credit appreciated.