A cell-wide sprite is now actually a cell wide
Rubble drawn to span its gap stopped short of the posts, and the ledger of blame is arithmetic: billboard widths scaled by the vertical pixel ratio (H/depth) when horizontal pixels-per-world-unit is the focal length over depth — about 1.4x larger. Every "one cell wide" volume rendered at seventy percent. Sprites that declare an aspect now mean WORLD width and use the horizontal scale, so rubble reaches post to post and hedges brush both walls; plain square token sprites keep their familiar pixel shape. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
5fc5805354
commit
700db70d4e
@@ -455,7 +455,13 @@
|
|||||||
const screenX = W / 2 + (side / depth) * (W / 2) / Math.tan(FOV / 2);
|
const screenX = W / 2 + (side / depth) * (W / 2) / Math.tan(FOV / 2);
|
||||||
const wallH = H / depth;
|
const wallH = H / depth;
|
||||||
const size = wallH * b.scale;
|
const size = wallH * b.scale;
|
||||||
const wide = size * (b.aspect ?? 1);
|
// Vertical pixels scale by H/depth, horizontal by focal/depth — and
|
||||||
|
// they differ. A sprite that declares an aspect means WORLD width
|
||||||
|
// (a hedge one cell wide must touch both posts), so its width uses
|
||||||
|
// the horizontal scale; plain square sprites keep their pixel shape.
|
||||||
|
const wide = b.aspect
|
||||||
|
? size * b.aspect * (((W / 2) / Math.tan(FOV / 2)) / H)
|
||||||
|
: size;
|
||||||
const bottom = half + wallH / 2 - b.rise * wallH;
|
const bottom = half + wallH / 2 - b.rise * wallH;
|
||||||
return {
|
return {
|
||||||
src: b.src, depth: depth - (b.bias ?? 0), warped: b.warped,
|
src: b.src, depth: depth - (b.bias ?? 0), warped: b.warped,
|
||||||
|
|||||||
@@ -339,7 +339,7 @@ export function billboards(
|
|||||||
if (content.kind === "thornbush" || content.kind === "rosebush") {
|
if (content.kind === "thornbush" || content.kind === "rosebush") {
|
||||||
out.push({
|
out.push({
|
||||||
...at, src: `/terrain3d/${content.kind}.png`, fallback: content.kind,
|
...at, src: `/terrain3d/${content.kind}.png`, fallback: content.kind,
|
||||||
scale: 0.5, aspect: 2.35, rise: 0, bias: 0.18, label: content.kind,
|
scale: 0.5, aspect: 2.1, rise: 0, bias: 0.18, label: content.kind,
|
||||||
});
|
});
|
||||||
} else if (content.kind === "ooze") {
|
} else if (content.kind === "ooze") {
|
||||||
out.push({
|
out.push({
|
||||||
|
|||||||
Reference in New Issue
Block a user