Merge branch 'feature/remove-thick-smooth-stone-wall'
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
@@ -550,7 +550,6 @@ const VARIANT_OUT = {
thin: { dir: "thin-stone-wall", named: true, prefix: "thin-stone-wall" }
},
smooth: {
thick: { dir: "thick-smooth-stone-wall", named: true, prefix: "thick-smooth-stone-wall" },
thin: { dir: "thin-smooth-stone-wall", named: true, prefix: "thin-smooth-stone-wall" }
},
brick: {
@@ -648,8 +647,10 @@ function bakeVariant (variant, { force = false } = {})
let wrote = 0;
for (const kind of ["thick", "thin"])
{
const shapeKey = `${kind}-stone-wall`;
const out = cfg[kind];
if (!out)
{ continue; }
const shapeKey = `${kind}-stone-wall`;
const outDir = join(ROOT, out.dir);
mkdirSync(outDir, { recursive: true });
const files = shapeFiles(shapeKey);
@@ -550,7 +550,6 @@ const VARIANT_OUT = { thin: { dir: "thin-stone-wall", named: true, prefix: "thin-stone-wall" } thin: { dir: "thin-stone-wall", named: true, prefix: "thin-stone-wall" } }, }, smooth: { smooth: { thick: { dir: "thick-smooth-stone-wall", named: true, prefix: "thick-smooth-stone-wall" }, thin: { dir: "thin-smooth-stone-wall", named: true, prefix: "thin-smooth-stone-wall" } thin: { dir: "thin-smooth-stone-wall", named: true, prefix: "thin-smooth-stone-wall" } }, }, brick: { brick: {@@ -648,8 +647,10 @@ function bakeVariant (variant, { force = false } = {}) let wrote = 0; let wrote = 0; for (const kind of ["thick", "thin"]) for (const kind of ["thick", "thin"]) { { const shapeKey = `${kind}-stone-wall`; const out = cfg[kind]; const out = cfg[kind]; if (!out) { continue; } const shapeKey = `${kind}-stone-wall`; const outDir = join(ROOT, out.dir); const outDir = join(ROOT, out.dir); mkdirSync(outDir, { recursive: true }); mkdirSync(outDir, { recursive: true }); const files = shapeFiles(shapeKey); const files = shapeFiles(shapeKey);@@ -6,16 +6,16 @@ import { smoothLitCorner } from "/shared/lighting/lightCorners.js";
import { bloomCompanionName, spriteImageName } from "/shared/definitions/tileSprites.js";
import { EQUIPMENT_SLOT, itemEquipSprite, itemSpriteName, itemDefinition } from "/shared/definitions/items.js";
import
{
resolveItemTint,
resolveEquipTint,
resolveItemDualTint,
resolveEquipDualTint,
normalizeRgb
} from "/shared/render/tint.js";
{
resolveItemTint,
resolveEquipTint,
resolveItemDualTint,
resolveEquipDualTint,
normalizeRgb
} from "/shared/render/tint.js";
import { layersFromSpawnerConfig } from "/shared/appearance/layers.js";
import { chargeSpriteFrameIndex, itemMaxCharges } from "/shared/items/charges.js";
import { normalizeGround, isWadeGroundInSeason, isWaterGround, isLiquidWaterGround, isGroundPassable, isBlockOccludingLight, LightOcclusion } from "/shared/definitions/tiles.js";
import { normalizeGround, normalizeBlock, isWadeGroundInSeason, isWaterGround, isLiquidWaterGround, isGroundPassable, isBlockOccludingLight, LightOcclusion, blockDefinition } from "/shared/definitions/tiles.js";
import { spriteCenterFromPivot, spriteDrawSize, tilePivot, ySortLayer, flightSortLayer } from "/shared/render/pivot.js";
import { bakeChunkAtlases, tileBlockSpriteEntry } from "./chunkBake.js";
import { createChunkAtlasCache } from "./chunkAtlasCache.js";
@@ -354,48 +354,36 @@ const ATLAS_LIGHTING_FRAG = [
].join("\n");
/**
* Block-row atlas: magenta → sample the ground atlas (u_bump) at the same
* tile-local UV (1:1 scale). The ground atlas already includes soft-terrain
* blending when that preference is on, so cliff tops match the floor beneath.
* Darkness matches ATLAS_LIGHTING_FRAG (lightmap in u_secondary).
* Per-tile cliff sprite: high-chroma / authored magenta top → sample this chunk's
* ground atlas (u_bump) at the cliff's tile-local UV. Only assigned to
* `cliffGroundTop` blocks — never to chunk block-row atlases (those keep normal
* lighting so magenta wood tints are not mistaken for cliff tops).
*/
const ATLAS_BLOCK_GROUND_TOP_FRAG = [
const SPRITE_CLIFF_GROUND_TOP_FRAG = [
"precision mediump float;",
"varying vec2 v_texCoord;",
"uniform sampler2D u_texture;",
"uniform sampler2D u_secondary;",
"uniform sampler2D u_bump;",
"uniform float u_alpha;",
"uniform float u_ambientDark;",
"uniform float u_lightRow;",
"uniform float u_darkness;",
"uniform vec2 u_tileLocal;",
"void main() {",
" vec4 color = texture2D(u_texture, v_texCoord);",
" if (color.a <= 0.0) { discard; }",
" vec3 rgb = color.rgb;",
" // Magenta family (R≈B, G<R): replace with blended ground under this pixel.",
" float rbDiff = abs(rgb.r - rgb.b);",
" if (rbDiff < 0.02 && rgb.g < rgb.r - 0.02) {",
" float tileX = floor(v_texCoord.x * 16.0);",
" float tileY = max(u_lightRow, 0.0);",
" float localX = fract(v_texCoord.x * 16.0);",
" float localY = v_texCoord.y;",
" vec2 groundUV = vec2((tileX + localX) / 16.0, (tileY + localY) / 16.0);",
" if (rbDiff < 0.02 && rgb.g < rgb.r) {",
" vec2 groundUV = (u_tileLocal + v_texCoord) / 16.0;",
" rgb = texture2D(u_bump, groundUV).rgb;",
" }",
" vec2 lightUV = v_texCoord;",
" if (u_lightRow >= 0.0) {",
" lightUV.y = (u_lightRow + v_texCoord.y) / 16.0;",
" }",
" float lit = texture2D(u_secondary, lightUV).r;",
" float darkness = u_ambientDark * (1.0 - lit);",
" rgb = mix(rgb, vec3(0.0), darkness);",
" rgb = mix(rgb, vec3(0.0), u_darkness);",
" gl_FragColor = vec4(rgb, color.a * u_alpha);",
"}"
].join("\n");
let spriteLightingShader = null;
let atlasLightingShader = null;
let atlasBlockGroundTopShader = null;
let cliffGroundTopShader = null;
let waterGroundShader = null;
let tintLitSpriteShader = null;
let dualTintLitSpriteShader = null;
@@ -416,11 +404,11 @@ function getAtlasLightingShader ()
return atlasLightingShader;
}
function getAtlasBlockGroundTopShader ()
function getCliffGroundTopShader ()
{
if (!atlasBlockGroundTopShader)
{ atlasBlockGroundTopShader = Shader.fragment(ATLAS_BLOCK_GROUND_TOP_FRAG); }
return atlasBlockGroundTopShader;
if (!cliffGroundTopShader)
{ cliffGroundTopShader = Shader.fragment(SPRITE_CLIFF_GROUND_TOP_FRAG); }
return cliffGroundTopShader;
}
function getWaterGroundShader ()
@@ -3346,7 +3334,7 @@ export class WorldView
for (let row = 0; row < CHUNK_SIZE; row++)
{
const object = new GameObject(0, 0, baked.blockImages[row], SORT_BLOCK);
this.#applyAtlasLighting(object, baked.lightmapImage, row, baked.groundImage);
this.#applyAtlasLighting(object, baked.lightmapImage, row);
this.scene.addObject(object);
baked.blockObjects.push(object);
}
@@ -3376,8 +3364,7 @@ export class WorldView
this.#applyAtlasLighting(
baked.blockObjects[row],
baked.lightmapImage,
row,
baked.groundImage
row
);
}
if (baked.bloomCanvas !== atlases.bloom)
@@ -3475,21 +3462,13 @@ export class WorldView
{ this.#scheduleTextureWarm(); }
}
#applyAtlasLighting (object, lightmapImage, lightRow, groundImage = null)
#applyAtlasLighting (object, lightmapImage, lightRow)
{
if (!object?.renderer)
{ return; }
object._lit = true;
if (groundImage)
{
object.renderer.shader = getAtlasBlockGroundTopShader();
object.renderer.bumpMap = groundImage;
}
else
{
object.renderer.shader = getAtlasLightingShader();
object.renderer.bumpMap = null;
}
object.renderer.shader = getAtlasLightingShader();
object.renderer.bumpMap = null;
object.renderer.secondaryMap = lightmapImage;
object.renderer.shaderUniforms = {
u_ambientDark: 0,
@@ -3497,6 +3476,21 @@ export class WorldView
};
}
#syncCliffGroundTopSprite (object, darkness, groundImage, localX, localY)
{
if (!object?.renderer)
{ return; }
object._lit = true;
const dark = Math.min(1, Math.max(0, darkness ?? 0));
object.renderer.shader = getCliffGroundTopShader();
object.renderer.bumpMap = groundImage ?? null;
object.renderer.secondaryMap = null;
object.renderer.shaderUniforms = {
u_darkness: dark,
u_tileLocal: [localX, localY]
};
}
#layoutBakedChunk (snapshot)
{
const key = `${snapshot.chunkX},${snapshot.chunkY}`;
@@ -3634,10 +3628,25 @@ export class WorldView
{
const pivot = tilePivot(tileX, tileY, this.tileSize());
objects.block = this.#ensureSprite(objects.block, tileBlock.sprite, SORT_ENTITY);
const blockDef = blockDefinition(normalizeBlock(snapshot.blocks[index])?.typeId);
objects.cliffGroundTop = !!blockDef?.cliffGroundTop;
if (objects.block)
{
this.#placePivoted(objects.block, pivot.x, pivot.y, pivot.y, SORT_ENTITY);
this.#syncLitSprite(objects.block, objects.shadeAlpha ?? 0);
if (objects.cliffGroundTop)
{
const localX = ((tileX % CHUNK_SIZE) + CHUNK_SIZE) % CHUNK_SIZE;
const localY = ((tileY % CHUNK_SIZE) + CHUNK_SIZE) % CHUNK_SIZE;
this.#syncCliffGroundTopSprite(
objects.block,
objects.shadeAlpha ?? 0,
baked?.groundImage ?? null,
localX,
localY
);
}
else
{ this.#syncLitSprite(objects.block, objects.shadeAlpha ?? 0); }
}
objects.blockBloom = this.#placeBloomOverlay(objects.blockBloom, tileBlock.bloom, pivot, SORT_ENTITY);
}
@@ -3647,6 +3656,7 @@ export class WorldView
objects.block = null;
objects.blockBloom?.destroy();
objects.blockBloom = null;
objects.cliffGroundTop = false;
}
}
@@ -3974,7 +3984,23 @@ export class WorldView
if (objects._inViewport === false)
{ continue; }
if (objects.block)
{ this.#syncLitSprite(objects.block, objects.shadeAlpha); }
{
if (objects.cliffGroundTop)
{
const baked = this.bakedChunks.get(`${objects.chunkX},${objects.chunkY}`);
const localX = ((objects.tileX % CHUNK_SIZE) + CHUNK_SIZE) % CHUNK_SIZE;
const localY = ((objects.tileY % CHUNK_SIZE) + CHUNK_SIZE) % CHUNK_SIZE;
this.#syncCliffGroundTopSprite(
objects.block,
objects.shadeAlpha,
baked?.groundImage ?? null,
localX,
localY
);
}
else
{ this.#syncLitSprite(objects.block, objects.shadeAlpha); }
}
if (objects.ground && isWaterGround(objects.groundTypeId))
{
const baked = this.bakedChunks.get(`${objects.chunkX},${objects.chunkY}`);
@@ -6,16 +6,16 @@ import { smoothLitCorner } from "/shared/lighting/lightCorners.js";import { bloomCompanionName, spriteImageName } from "/shared/definitions/tileSprites.js";import { bloomCompanionName, spriteImageName } from "/shared/definitions/tileSprites.js";import { EQUIPMENT_SLOT, itemEquipSprite, itemSpriteName, itemDefinition } from "/shared/definitions/items.js";import { EQUIPMENT_SLOT, itemEquipSprite, itemSpriteName, itemDefinition } from "/shared/definitions/items.js";importimport {{ resolveItemTint, resolveItemTint, resolveEquipTint, resolveEquipTint, resolveItemDualTint, resolveItemDualTint, resolveEquipDualTint, resolveEquipDualTint, normalizeRgb normalizeRgb } from "/shared/render/tint.js";} from "/shared/render/tint.js";import { layersFromSpawnerConfig } from "/shared/appearance/layers.js";import { layersFromSpawnerConfig } from "/shared/appearance/layers.js";import { chargeSpriteFrameIndex, itemMaxCharges } from "/shared/items/charges.js";import { chargeSpriteFrameIndex, itemMaxCharges } from "/shared/items/charges.js";import { normalizeGround, isWadeGroundInSeason, isWaterGround, isLiquidWaterGround, isGroundPassable, isBlockOccludingLight, LightOcclusion } from "/shared/definitions/tiles.js";import { normalizeGround, normalizeBlock, isWadeGroundInSeason, isWaterGround, isLiquidWaterGround, isGroundPassable, isBlockOccludingLight, LightOcclusion, blockDefinition } from "/shared/definitions/tiles.js";import { spriteCenterFromPivot, spriteDrawSize, tilePivot, ySortLayer, flightSortLayer } from "/shared/render/pivot.js";import { spriteCenterFromPivot, spriteDrawSize, tilePivot, ySortLayer, flightSortLayer } from "/shared/render/pivot.js";import { bakeChunkAtlases, tileBlockSpriteEntry } from "./chunkBake.js";import { bakeChunkAtlases, tileBlockSpriteEntry } from "./chunkBake.js";import { createChunkAtlasCache } from "./chunkAtlasCache.js";import { createChunkAtlasCache } from "./chunkAtlasCache.js";@@ -354,48 +354,36 @@ const ATLAS_LIGHTING_FRAG = [].join("\n");].join("\n");/**/** * Block-row atlas: magenta → sample the ground atlas (u_bump) at the same * Per-tile cliff sprite: high-chroma / authored magenta top → sample this chunk's * tile-local UV (1:1 scale). The ground atlas already includes soft-terrain * ground atlas (u_bump) at the cliff's tile-local UV. Only assigned to * blending when that preference is on, so cliff tops match the floor beneath. * `cliffGroundTop` blocks — never to chunk block-row atlases (those keep normal * Darkness matches ATLAS_LIGHTING_FRAG (lightmap in u_secondary). * lighting so magenta wood tints are not mistaken for cliff tops). */ */const ATLAS_BLOCK_GROUND_TOP_FRAG = [const SPRITE_CLIFF_GROUND_TOP_FRAG = [ "precision mediump float;", "precision mediump float;", "varying vec2 v_texCoord;", "varying vec2 v_texCoord;", "uniform sampler2D u_texture;", "uniform sampler2D u_texture;", "uniform sampler2D u_secondary;", "uniform sampler2D u_bump;", "uniform sampler2D u_bump;", "uniform float u_alpha;", "uniform float u_alpha;", "uniform float u_ambientDark;", "uniform float u_darkness;", "uniform float u_lightRow;", "uniform vec2 u_tileLocal;", "void main() {", "void main() {", " vec4 color = texture2D(u_texture, v_texCoord);", " vec4 color = texture2D(u_texture, v_texCoord);", " if (color.a <= 0.0) { discard; }", " if (color.a <= 0.0) { discard; }", " vec3 rgb = color.rgb;", " vec3 rgb = color.rgb;", " // Magenta family (R≈B, G<R): replace with blended ground under this pixel.", " float rbDiff = abs(rgb.r - rgb.b);", " float rbDiff = abs(rgb.r - rgb.b);", " if (rbDiff < 0.02 && rgb.g < rgb.r - 0.02) {", " if (rbDiff < 0.02 && rgb.g < rgb.r) {", " float tileX = floor(v_texCoord.x * 16.0);", " vec2 groundUV = (u_tileLocal + v_texCoord) / 16.0;", " float tileY = max(u_lightRow, 0.0);", " float localX = fract(v_texCoord.x * 16.0);", " float localY = v_texCoord.y;", " vec2 groundUV = vec2((tileX + localX) / 16.0, (tileY + localY) / 16.0);", " rgb = texture2D(u_bump, groundUV).rgb;", " rgb = texture2D(u_bump, groundUV).rgb;", " }", " }", " vec2 lightUV = v_texCoord;", " rgb = mix(rgb, vec3(0.0), u_darkness);", " if (u_lightRow >= 0.0) {", " lightUV.y = (u_lightRow + v_texCoord.y) / 16.0;", " }", " float lit = texture2D(u_secondary, lightUV).r;", " float darkness = u_ambientDark * (1.0 - lit);", " rgb = mix(rgb, vec3(0.0), darkness);", " gl_FragColor = vec4(rgb, color.a * u_alpha);", " gl_FragColor = vec4(rgb, color.a * u_alpha);", "}" "}"].join("\n");].join("\n");let spriteLightingShader = null;let spriteLightingShader = null;let atlasLightingShader = null;let atlasLightingShader = null;let atlasBlockGroundTopShader = null;let cliffGroundTopShader = null;let waterGroundShader = null;let waterGroundShader = null;let tintLitSpriteShader = null;let tintLitSpriteShader = null;let dualTintLitSpriteShader = null;let dualTintLitSpriteShader = null;@@ -416,11 +404,11 @@ function getAtlasLightingShader () return atlasLightingShader; return atlasLightingShader;}}function getAtlasBlockGroundTopShader ()function getCliffGroundTopShader (){{ if (!atlasBlockGroundTopShader) if (!cliffGroundTopShader) { atlasBlockGroundTopShader = Shader.fragment(ATLAS_BLOCK_GROUND_TOP_FRAG); } { cliffGroundTopShader = Shader.fragment(SPRITE_CLIFF_GROUND_TOP_FRAG); } return atlasBlockGroundTopShader; return cliffGroundTopShader;}}function getWaterGroundShader ()function getWaterGroundShader ()@@ -3346,7 +3334,7 @@ export class WorldView for (let row = 0; row < CHUNK_SIZE; row++) for (let row = 0; row < CHUNK_SIZE; row++) { { const object = new GameObject(0, 0, baked.blockImages[row], SORT_BLOCK); const object = new GameObject(0, 0, baked.blockImages[row], SORT_BLOCK); this.#applyAtlasLighting(object, baked.lightmapImage, row, baked.groundImage); this.#applyAtlasLighting(object, baked.lightmapImage, row); this.scene.addObject(object); this.scene.addObject(object); baked.blockObjects.push(object); baked.blockObjects.push(object); } }@@ -3376,8 +3364,7 @@ export class WorldView this.#applyAtlasLighting( this.#applyAtlasLighting( baked.blockObjects[row], baked.blockObjects[row], baked.lightmapImage, baked.lightmapImage, row, row baked.groundImage ); ); } } if (baked.bloomCanvas !== atlases.bloom) if (baked.bloomCanvas !== atlases.bloom)@@ -3475,21 +3462,13 @@ export class WorldView { this.#scheduleTextureWarm(); } { this.#scheduleTextureWarm(); } } } #applyAtlasLighting (object, lightmapImage, lightRow, groundImage = null) #applyAtlasLighting (object, lightmapImage, lightRow) { { if (!object?.renderer) if (!object?.renderer) { return; } { return; } object._lit = true; object._lit = true; if (groundImage) object.renderer.shader = getAtlasLightingShader(); { object.renderer.bumpMap = null; object.renderer.shader = getAtlasBlockGroundTopShader(); object.renderer.bumpMap = groundImage; } else { object.renderer.shader = getAtlasLightingShader(); object.renderer.bumpMap = null; } object.renderer.secondaryMap = lightmapImage; object.renderer.secondaryMap = lightmapImage; object.renderer.shaderUniforms = { object.renderer.shaderUniforms = { u_ambientDark: 0, u_ambientDark: 0,@@ -3497,6 +3476,21 @@ export class WorldView }; }; } } #syncCliffGroundTopSprite (object, darkness, groundImage, localX, localY) { if (!object?.renderer) { return; } object._lit = true; const dark = Math.min(1, Math.max(0, darkness ?? 0)); object.renderer.shader = getCliffGroundTopShader(); object.renderer.bumpMap = groundImage ?? null; object.renderer.secondaryMap = null; object.renderer.shaderUniforms = { u_darkness: dark, u_tileLocal: [localX, localY] }; } #layoutBakedChunk (snapshot) #layoutBakedChunk (snapshot) { { const key = `${snapshot.chunkX},${snapshot.chunkY}`; const key = `${snapshot.chunkX},${snapshot.chunkY}`;@@ -3634,10 +3628,25 @@ export class WorldView { { const pivot = tilePivot(tileX, tileY, this.tileSize()); const pivot = tilePivot(tileX, tileY, this.tileSize()); objects.block = this.#ensureSprite(objects.block, tileBlock.sprite, SORT_ENTITY); objects.block = this.#ensureSprite(objects.block, tileBlock.sprite, SORT_ENTITY); const blockDef = blockDefinition(normalizeBlock(snapshot.blocks[index])?.typeId); objects.cliffGroundTop = !!blockDef?.cliffGroundTop; if (objects.block) if (objects.block) { { this.#placePivoted(objects.block, pivot.x, pivot.y, pivot.y, SORT_ENTITY); this.#placePivoted(objects.block, pivot.x, pivot.y, pivot.y, SORT_ENTITY); this.#syncLitSprite(objects.block, objects.shadeAlpha ?? 0); if (objects.cliffGroundTop) { const localX = ((tileX % CHUNK_SIZE) + CHUNK_SIZE) % CHUNK_SIZE; const localY = ((tileY % CHUNK_SIZE) + CHUNK_SIZE) % CHUNK_SIZE; this.#syncCliffGroundTopSprite( objects.block, objects.shadeAlpha ?? 0, baked?.groundImage ?? null, localX, localY ); } else { this.#syncLitSprite(objects.block, objects.shadeAlpha ?? 0); } } } objects.blockBloom = this.#placeBloomOverlay(objects.blockBloom, tileBlock.bloom, pivot, SORT_ENTITY); objects.blockBloom = this.#placeBloomOverlay(objects.blockBloom, tileBlock.bloom, pivot, SORT_ENTITY); } }@@ -3647,6 +3656,7 @@ export class WorldView objects.block = null; objects.block = null; objects.blockBloom?.destroy(); objects.blockBloom?.destroy(); objects.blockBloom = null; objects.blockBloom = null; objects.cliffGroundTop = false; } } } }@@ -3974,7 +3984,23 @@ export class WorldView if (objects._inViewport === false) if (objects._inViewport === false) { continue; } { continue; } if (objects.block) if (objects.block) { this.#syncLitSprite(objects.block, objects.shadeAlpha); } { if (objects.cliffGroundTop) { const baked = this.bakedChunks.get(`${objects.chunkX},${objects.chunkY}`); const localX = ((objects.tileX % CHUNK_SIZE) + CHUNK_SIZE) % CHUNK_SIZE; const localY = ((objects.tileY % CHUNK_SIZE) + CHUNK_SIZE) % CHUNK_SIZE; this.#syncCliffGroundTopSprite( objects.block, objects.shadeAlpha, baked?.groundImage ?? null, localX, localY ); } else { this.#syncLitSprite(objects.block, objects.shadeAlpha); } } if (objects.ground && isWaterGround(objects.groundTypeId)) if (objects.ground && isWaterGround(objects.groundTypeId)) { { const baked = this.bakedChunks.get(`${objects.chunkX},${objects.chunkY}`); const baked = this.bakedChunks.get(`${objects.chunkX},${objects.chunkY}`);@@ -35,6 +35,12 @@ test("stone walls remain chunk-atlas baked", () =>
assert.equal(isChunkAtlasBakedBlock({ typeId: BlockType.stoneWall }), true);
});
test("cliff blocks are per-tile (ground-top shader), not atlas-baked", () =>
{
assert.equal(isChunkAtlasBakedBlock({ typeId: BlockType.cliff }), false);
assert.equal(isChunkAtlasBakedBlock({ typeId: BlockType.cliffThin }), false);
});
test("runtime campfires are not chunk-atlas baked", () =>
{
assert.equal(isChunkAtlasBakedBlock({
@@ -35,6 +35,12 @@ test("stone walls remain chunk-atlas baked", () => assert.equal(isChunkAtlasBakedBlock({ typeId: BlockType.stoneWall }), true); assert.equal(isChunkAtlasBakedBlock({ typeId: BlockType.stoneWall }), true);});});test("cliff blocks are per-tile (ground-top shader), not atlas-baked", () =>{ assert.equal(isChunkAtlasBakedBlock({ typeId: BlockType.cliff }), false); assert.equal(isChunkAtlasBakedBlock({ typeId: BlockType.cliffThin }), false);});test("runtime campfires are not chunk-atlas baked", () =>test("runtime campfires are not chunk-atlas baked", () =>{{ assert.equal(isChunkAtlasBakedBlock({ assert.equal(isChunkAtlasBakedBlock({@@ -23,9 +23,9 @@ test("sprite folders expose alphabetical states; first is default", () =>
assert.equal(catalog.blocks["thin-stone-wall"].defaultState, "thin-stone-wall");
assert.equal(catalog.blocks["thin-stone-wall"].states.length, 16);
assert.ok(catalog.images.some((image) => image.name === "block:thin-stone-wall:thin-stone-wall-wne"));
assert.equal(catalog.blocks["thick-smooth-stone-wall"].states.length, 16);
assert.equal(catalog.blocks["thin-smooth-stone-wall"].states.length, 16);
assert.ok(catalog.images.some((image) => image.name === "block:thick-smooth-stone-wall:thick-smooth-stone-wall"));
assert.ok(catalog.images.some((image) => image.name === "block:thin-smooth-stone-wall:thin-smooth-stone-wall"));
assert.equal(catalog.blocks["thick-smooth-stone-wall"], undefined);
assert.equal(catalog.blocks["thick-brick-wall"].states.length, 16);
assert.equal(catalog.blocks["thin-brick-wall"].states.length, 16);
assert.ok(catalog.images.some((image) => image.name === "block:thick-brick-wall:thick-brick-wall-we"));
@@ -23,9 +23,9 @@ test("sprite folders expose alphabetical states; first is default", () => assert.equal(catalog.blocks["thin-stone-wall"].defaultState, "thin-stone-wall"); assert.equal(catalog.blocks["thin-stone-wall"].defaultState, "thin-stone-wall"); assert.equal(catalog.blocks["thin-stone-wall"].states.length, 16); assert.equal(catalog.blocks["thin-stone-wall"].states.length, 16); assert.ok(catalog.images.some((image) => image.name === "block:thin-stone-wall:thin-stone-wall-wne")); assert.ok(catalog.images.some((image) => image.name === "block:thin-stone-wall:thin-stone-wall-wne")); assert.equal(catalog.blocks["thick-smooth-stone-wall"].states.length, 16); assert.equal(catalog.blocks["thin-smooth-stone-wall"].states.length, 16); assert.equal(catalog.blocks["thin-smooth-stone-wall"].states.length, 16); assert.ok(catalog.images.some((image) => image.name === "block:thick-smooth-stone-wall:thick-smooth-stone-wall")); assert.ok(catalog.images.some((image) => image.name === "block:thin-smooth-stone-wall:thin-smooth-stone-wall")); assert.equal(catalog.blocks["thick-smooth-stone-wall"], undefined); assert.equal(catalog.blocks["thick-brick-wall"].states.length, 16); assert.equal(catalog.blocks["thick-brick-wall"].states.length, 16); assert.equal(catalog.blocks["thin-brick-wall"].states.length, 16); assert.equal(catalog.blocks["thin-brick-wall"].states.length, 16); assert.ok(catalog.images.some((image) => image.name === "block:thick-brick-wall:thick-brick-wall-we")); assert.ok(catalog.images.some((image) => image.name === "block:thick-brick-wall:thick-brick-wall-we"));