BlueGit

timfa questward

Add face-aware plank grain to magenta wood wall masks.

Sides use horizontal plank bands with outer/inner swap; south gets vertical boards; tops get lighter grain. Pattern follows the authored thick 1×1 so all connect states tint cleanly per wood tier.

timfa Tim Falken · pushed by timfa

Authored 2026-08-31 · 2 months ago

Hash
d29965dc846e92f3796c370dcccde19bc56db5dc
Parent
8d3b18aa
33 files changed +76 −6
client/assets/blocks/thick-wood-wall/0.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thick-wood-wall/1.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thick-wood-wall/10.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thick-wood-wall/11.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thick-wood-wall/12.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thick-wood-wall/13.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thick-wood-wall/14.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thick-wood-wall/15.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thick-wood-wall/2.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thick-wood-wall/3.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thick-wood-wall/4.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thick-wood-wall/5.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thick-wood-wall/6.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thick-wood-wall/7.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thick-wood-wall/8.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thick-wood-wall/9.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thin-wood-wall/0.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thin-wood-wall/1.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thin-wood-wall/10.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thin-wood-wall/11.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thin-wood-wall/12.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thin-wood-wall/13.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thin-wood-wall/14.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thin-wood-wall/15.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thin-wood-wall/2.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thin-wood-wall/3.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thin-wood-wall/4.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thin-wood-wall/5.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thin-wood-wall/6.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thin-wood-wall/7.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thin-wood-wall/8.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/thin-wood-wall/9.png Binary file +0 −0

The contents of this binary file are not shown.

client/scripts/texture-wall-sprites.mjs +76 −6
@@ -386,19 +386,89 @@ function isSameFace (faceRgba, x, y, role, shapePrefix)
386 386
387 387 function woodMagenta (role)
388 388 {
389 // R≈B, G<R — lightness encodes face.
389 // Flat fallback (role only) — prefer woodShade for textured planks.
390 390 const L = {
391 391 O: 55,
392 392 S: 95,
393 E: 120,
394 W: 155,
395 T: 185,
396 N: 210
393 E: 113,
394 W: 143,
395 T: 177,
396 N: 205
397 397 }[role] ?? 140;
398 398 const gHi = role === "N" || role === "T" ? Math.min(L - 20, 50) : 0;
399 399 return rgba(L, gHi, L);
400 400 }
401 401
402 /** Magenta (R=B, G<R) with face-aware plank grain, matching authored thick 1×1. */
403 function mag (L, g = 0)
404 {
405 const lit = Math.max(1, Math.min(255, L | 0));
406 const gv = Math.max(0, Math.min(lit - 1, g | 0));
407 return rgba(lit, gv, lit);
408 }
409
410 /**
411 * Wood planks by face (from thick-wood-wall/0.png reference):
412 * - S: vertical boards (~4px), alternating grain by board+row
413 * - W/E: horizontal plank bands; outer/inner columns swap each band (diagonal step)
414 * - T: N–S boards with brighter center grain + slight G highlight
415 * - N: bright rim, two-tone split
416 */
417 function woodShade (x, y, role, shapePrefix, faceRgba)
418 {
419 if (role === "O")
420 { return mag(55); }
421
422 if (role === "S")
423 {
424 const board = Math.floor(x / 4);
425 const light = ((board + y) & 1) !== 0;
426 return mag(light ? 102 : 95);
427 }
428
429 if (role === "W" || role === "E")
430 {
431 const lo = role === "W" ? 143 : 113;
432 const hi = role === "W" ? 155 : 120;
433 // Plank bands ~5px tall, aligned like authored alone (y2–6, y7–11, …).
434 const band = Math.floor(Math.max(0, y - 2) / 5);
435 const outer = role === "W"
436 ? !isSameFace(faceRgba, x - 1, y, role, shapePrefix)
437 : !isSameFace(faceRgba, x + 1, y, role, shapePrefix);
438 const swap = (band & 1) !== 0;
439 let useHi;
440 if (outer)
441 { useHi = swap; }
442 else
443 { useHi = !swap; }
444 return mag(useHi ? hi : lo);
445 }
446
447 if (role === "T" || (shapePrefix.startsWith("thin") && role === "N"))
448 {
449 const rowTone = (y & 1) !== 0;
450 const leftEdge = !isSameFace(faceRgba, x - 1, y, role, shapePrefix);
451 const rightEdge = !isSameFace(faceRgba, x + 1, y, role, shapePrefix);
452 const edge = leftEdge || rightEdge;
453 let L;
454 if (edge)
455 { L = rowTone ? 161 : 159; }
456 else
457 { L = rowTone ? 177 : 168; }
458 const g = rowTone ? 20 : 0;
459 return mag(L, g);
460 }
461
462 if (role === "N")
463 {
464 // Thick north bevel: split highlight
465 const L = x < 8 ? 200 : 210;
466 return mag(L, x < 8 ? 47 : 50);
467 }
468
469 return woodMagenta(role);
470 }
471
402 472 /**
403 473 * Cliff magenta tops: thick = plateau only (N is a dirt north face).
404 474 * Thin has no separate T — ridge top is role N.
@@ -448,7 +518,7 @@ function paintPixel (variant, prefix, g, x, y, faceRgba = null)
448 518 if (variant === "brick")
449 519 { return brickShade(x, y, role, prefix, faceRgba); }
450 520 if (variant === "wood")
451 { return woodMagenta(role); }
521 { return woodShade(x, y, role, prefix, faceRgba); }
452 522 if (variant === "cliff")
453 523 { return cliffShade(x, y, role, prefix); }
454 524 throw new Error(`Unknown variant ${variant}`);
@@ -386,19 +386,89 @@ function isSameFace (faceRgba, x, y, role, shapePrefix)
386
386
387function woodMagenta (role)
387function woodMagenta (role)
388{
388{
389 // R≈B, G<R — lightness encodes face.
389 // Flat fallback (role only) — prefer woodShade for textured planks.
390 const L = {
390 const L = {
391 O: 55,
391 O: 55,
392 S: 95,
392 S: 95,
393 E: 120,
393 E: 113,
394 W: 155,
394 W: 143,
395 T: 185,
395 T: 177,
396 N: 210
396 N: 205
397 }[role] ?? 140;
397 }[role] ?? 140;
398 const gHi = role === "N" || role === "T" ? Math.min(L - 20, 50) : 0;
398 const gHi = role === "N" || role === "T" ? Math.min(L - 20, 50) : 0;
399 return rgba(L, gHi, L);
399 return rgba(L, gHi, L);
400}
400}
401
401
402/** Magenta (R=B, G<R) with face-aware plank grain, matching authored thick 1×1. */
403function mag (L, g = 0)
404{
405 const lit = Math.max(1, Math.min(255, L | 0));
406 const gv = Math.max(0, Math.min(lit - 1, g | 0));
407 return rgba(lit, gv, lit);
408}
409
410/**
411 * Wood planks by face (from thick-wood-wall/0.png reference):
412 * - S: vertical boards (~4px), alternating grain by board+row
413 * - W/E: horizontal plank bands; outer/inner columns swap each band (diagonal step)
414 * - T: N–S boards with brighter center grain + slight G highlight
415 * - N: bright rim, two-tone split
416 */
417function woodShade (x, y, role, shapePrefix, faceRgba)
418{
419 if (role === "O")
420 { return mag(55); }
421
422 if (role === "S")
423 {
424 const board = Math.floor(x / 4);
425 const light = ((board + y) & 1) !== 0;
426 return mag(light ? 102 : 95);
427 }
428
429 if (role === "W" || role === "E")
430 {
431 const lo = role === "W" ? 143 : 113;
432 const hi = role === "W" ? 155 : 120;
433 // Plank bands ~5px tall, aligned like authored alone (y2–6, y7–11, …).
434 const band = Math.floor(Math.max(0, y - 2) / 5);
435 const outer = role === "W"
436 ? !isSameFace(faceRgba, x - 1, y, role, shapePrefix)
437 : !isSameFace(faceRgba, x + 1, y, role, shapePrefix);
438 const swap = (band & 1) !== 0;
439 let useHi;
440 if (outer)
441 { useHi = swap; }
442 else
443 { useHi = !swap; }
444 return mag(useHi ? hi : lo);
445 }
446
447 if (role === "T" || (shapePrefix.startsWith("thin") && role === "N"))
448 {
449 const rowTone = (y & 1) !== 0;
450 const leftEdge = !isSameFace(faceRgba, x - 1, y, role, shapePrefix);
451 const rightEdge = !isSameFace(faceRgba, x + 1, y, role, shapePrefix);
452 const edge = leftEdge || rightEdge;
453 let L;
454 if (edge)
455 { L = rowTone ? 161 : 159; }
456 else
457 { L = rowTone ? 177 : 168; }
458 const g = rowTone ? 20 : 0;
459 return mag(L, g);
460 }
461
462 if (role === "N")
463 {
464 // Thick north bevel: split highlight
465 const L = x < 8 ? 200 : 210;
466 return mag(L, x < 8 ? 47 : 50);
467 }
468
469 return woodMagenta(role);
470}
471
402/**
472/**
403 * Cliff magenta tops: thick = plateau only (N is a dirt north face).
473 * Cliff magenta tops: thick = plateau only (N is a dirt north face).
404 * Thin has no separate T — ridge top is role N.
474 * Thin has no separate T — ridge top is role N.
@@ -448,7 +518,7 @@ function paintPixel (variant, prefix, g, x, y, faceRgba = null)
448 if (variant === "brick")
518 if (variant === "brick")
449 { return brickShade(x, y, role, prefix, faceRgba); }
519 { return brickShade(x, y, role, prefix, faceRgba); }
450 if (variant === "wood")
520 if (variant === "wood")
451 { return woodMagenta(role); }
521 { return woodShade(x, y, role, prefix, faceRgba); }
452 if (variant === "cliff")
522 if (variant === "cliff")
453 { return cliffShade(x, y, role, prefix); }
523 { return cliffShade(x, y, role, prefix); }
454 throw new Error(`Unknown variant ${variant}`);
524 throw new Error(`Unknown variant ${variant}`);