Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flat shading for vertex colors #65

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
flat shading for vertex colors
kion-dgl committed Sep 27, 2024
commit 76630ab6eef1fd863ced957a6e757e9c32af3d7c
8 changes: 8 additions & 0 deletions src/ST03.ts
Original file line number Diff line number Diff line change
@@ -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);

8 changes: 8 additions & 0 deletions src/ST0305.ts
Original file line number Diff line number Diff line change
@@ -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);