feat: birch

This commit is contained in:
Dan Finch 2026-08-07 13:01:32 +02:00
parent 16f205babe
commit a4490f7a20
11 changed files with 110 additions and 24 deletions

View file

@ -126,6 +126,18 @@ const bark: Shade = (x, y) => {
return [92 + n + grain + crack, 66 + n * 0.8 + grain * 0.6 + crack, 44 + n * 0.6 + crack, 255]
}
// Silver birch bark: papery near-white with faint grey mottle and the dark
// horizontal lenticel dashes that make a birch read as a birch.
const birch: Shade = (x, y) => {
const n = noise(x, y) * 8
// Dark dashes: short random runs on a few rows, wrapping the trunk horizontally.
if (y % 8 < 3 && noise(Math.floor(x / 6), Math.floor(y / 8)) > 0.3) {
return [38 + n, 38 + n, 40 + n, 255]
}
const smudge = noise(Math.floor(x / 10), Math.floor(y / 10)) < -0.4 ? -22 : 0
return [216 + n + smudge, 218 + n + smudge, 214 + n + smudge, 255]
}
// Oak leaves: mid green, blotchy clumps with brighter highlights.
const leaf: Shade = (x, y) => {
const n = noise(x, y) * 26
@ -249,6 +261,7 @@ const assets: Array<[string, number, number, Shade]> = [
["floor", 64, 64, floor],
["grass", 64, 64, grass],
["bark", 64, 64, bark],
["birch", 64, 64, birch],
["leaf", 64, 64, leaf],
["needle", 64, 64, needle],
["rock", 64, 64, rock],