From 76630ab6eef1fd863ced957a6e757e9c32af3d7c Mon Sep 17 00:00:00 2001 From: kion Date: Fri, 27 Sep 2024 11:22:46 +0900 Subject: [PATCH] flat shading for vertex colors --- src/ST03.ts | 8 ++++++++ src/ST0305.ts | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/ST03.ts b/src/ST03.ts index 7afec20..dd45821 100644 --- a/src/ST03.ts +++ b/src/ST03.ts @@ -303,6 +303,14 @@ const updateSceneModel = () => { packMesh(buffer, "miku/apron/09_RIGHT_HAND_PLATE.obj", 0x1c0, meta); // 017 packMesh(buffer, "miku/apron/06_LEFT_HAND_PAN.obj", 0x1d0, meta); // 018 + // Update Vertex Colors + for (let ofs = 0x1e70; ofs < 0x2524; ofs += 4) { + buffer[ofs + 0] = 0x7f; + buffer[ofs + 1] = 0x7f; + buffer[ofs + 2] = 0x7f; + buffer[ofs + 3] = 0; + } + const content = Buffer.from(buffer.subarray(0, meta.contentEnd)); const [bitField, updatedScene] = compressScene(content); diff --git a/src/ST0305.ts b/src/ST0305.ts index 5fa5b83..0f90667 100644 --- a/src/ST0305.ts +++ b/src/ST0305.ts @@ -607,6 +607,14 @@ const encodeApronMegaman = () => { packMesh(buffer, "miku/apron/09_RIGHT_HAND_PLATE.obj", 0x1d0, meta); // 017 packMesh(buffer, "miku/apron/06_LEFT_HAND_PAN.obj", 0x1e0, meta); // 018 + // Update Vertex Colors + for (let ofs = 0x1e80; ofs < 0x2534; ofs += 4) { + buffer[ofs + 0] = 0x7f; + buffer[ofs + 1] = 0x7f; + buffer[ofs + 2] = 0x7f; + buffer[ofs + 3] = 0; + } + // Update the content length to read file.writeUInt32LE(meta.contentEnd, 0x04); // file.writeUInt32LE(0x1d, 0x08);