Compare commits

..
Author SHA1 Message Date
tresabhi 2e2585e605 polyfill both tank model and armor 2026-12-03 21:23:34 -06:00
tresabhi eda6eb280f polyfill missing attributes across meshes 2026-12-02 17:06:33 -06:00
tresabhi 9b81166114 remove medoiump 2026-12-02 16:55:28 -06:00
tresabhi b9f5d13415 optional filepath 2026-12-01 10:28:45 -06:00
tresabhi e48f4e31c8 bump 2026-11-30 22:52:54 -06:00
tresabhi 11c2edcfff logs 2026-11-30 22:50:15 -06:00
15 changed files with 92 additions and 17 deletions

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
# BlitzKit 1.33.1
Thank you to [HitJack](https://github.com/Hitjack007) for your contributions this update.
## Features
- Legendary camouflages in Tankopedia are now animated and loop their garage animations [HitJack]
- Tankopedia's 3D viewer is now much faster as tank models, armor, and legendary camouflages are drawn in batches
- Shadows are now only redrawn when something in the scene changes instead of every frame, saving battery and GPU time
## Fixes
- Unused parts of legendary camouflages are now hidden, fixing camouflages like the Maus' [HitJack]
- Legendary camouflage parts with no LODs are no longer missing, like the Tiger II's cat and the BDT-5A's engine rings [HitJack]
- The ground in Tankopedia is no longer transparent, so it fades out cleanly instead of blending with things behind it
## Technical Changes
- Tank and legendary camouflage models build much faster thanks to a faster DDS decoder and native CRC32 checksums [HitJack]
- The game client is now downloaded from Wargaming Game Center by default
- Added a zip-backed virtual file system for reading game files
+3
View File
@@ -0,0 +1,3 @@
# BlitzKit 1.33.2
Fixed an issue that caused the armor of some tanks like the Type 71 to crash BlitzKit.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "blitzkit",
"version": "1.33.0",
"version": "1.33.2",
"license": "BlitzKit License",
"private": true,
"type": "module",
+1 -1
View File
@@ -266,7 +266,7 @@ export type Component =
}
| {
"comp.typename": "MotionComponent";
"motion.filepath": string;
"motion.filepath"?: string;
"motion.playbackRate": number;
"simpleMotion.repeatsCount": number;
}
@@ -1,5 +1,3 @@
precision mediump float;
varying vec3 vNormal;
varying vec3 vViewPosition;
@@ -1,5 +1,3 @@
precision mediump float;
varying vec3 vNormal;
varying vec3 vViewPosition;
varying float vThickness;
@@ -1,5 +1,3 @@
precision mediump float;
uniform float thickness;
uniform float penetration;
@@ -1,5 +1,3 @@
precision mediump float;
#include <batching_pars_vertex>
#include <clipping_planes_pars_vertex>
@@ -1,5 +1,3 @@
precision mediump float;
varying vec3 vNormal;
varying vec3 vViewPosition;
@@ -1,5 +1,3 @@
precision mediump float;
varying vec3 vNormal;
varying vec3 vViewPosition;
varying float vThickness;
@@ -0,0 +1,51 @@
import type {
Accessor,
Buffer,
Document,
TypedArray,
} from "@gltf-transform/core";
/**
* The website batches primitives into BatchedMeshes, which need every
* primitive in them to have the same attributes. Batches cross materials (the
* armor view batches wheels with tracks), so a primitive missing an attribute
* any other in the document has (say TEXCOORD_1) gets it zero-filled, which is
* what the shader read for the missing attribute anyway.
*/
export function polyfillAttributes(document: Document, buffer: Buffer) {
const primitives = document
.getRoot()
.listMeshes()
.flatMap((mesh) => mesh.listPrimitives());
const references = new Map<string, Accessor>();
for (const primitive of primitives) {
for (const name of primitive.listSemantics()) {
if (!references.has(name)) {
references.set(name, primitive.getAttribute(name)!);
}
}
}
for (const primitive of primitives) {
const count = primitive.getAttribute("POSITION")!.getCount();
for (const [name, reference] of references) {
if (primitive.getAttribute(name) !== null) continue;
const Array = reference.getArray()!.constructor as new (
length: number,
) => TypedArray;
primitive.setAttribute(
name,
document
.createAccessor(name)
.setType(reference.getType())
.setNormalized(reference.getNormalized())
.setArray(new Array(count * reference.getElementSize()))
.setBuffer(buffer),
);
}
}
}
@@ -10,6 +10,7 @@ import {
import type { AbstractVFS } from "@blitzkit/core/src/blitzkit/vfs/abstract";
import { Accessor, Document, Node, NodeIO, Scene } from "@gltf-transform/core";
import type { APIContext } from "astro";
import { polyfillAttributes } from "../../../core/blitzkit/polyfillAttributes";
import { vfs } from "../../../core/blitzkit/vfs";
export { getStaticPaths } from "./_index";
@@ -163,6 +164,8 @@ async function extractArmor(vfs: AbstractVFS, fileName: string) {
},
);
polyfillAttributes(document, buffer);
return document;
}
@@ -28,6 +28,7 @@ import type { APIContext } from "astro";
import { isEqual, times } from "lodash-es";
import { dirname } from "path";
import sharp from "sharp";
import { polyfillAttributes } from "../../../core/blitzkit/polyfillAttributes";
import type { Motion } from "../../../core/blitzkit/skinAnimations/motion";
import {
bindSocket,
@@ -125,7 +126,12 @@ export async function extractModel(
parseHierarchies(sc2["#hierarchy"], null, (hierarchy, components) => {
for (const component of components) {
if (component["comp.typename"] !== "MotionComponent") continue;
if (
component["comp.typename"] !== "MotionComponent" ||
component["motion.filepath"] === undefined
) {
continue;
}
loading.push(
loadMotion(vfs, path, component).then((motion) => {
@@ -365,6 +371,9 @@ export async function extractModel(
await document.transform(prune({ keepAttributes: true }), dedup());
// parts aren't batched so their bones can animate
if (!isPart) polyfillAttributes(document, buffer);
return document;
}
@@ -40,5 +40,5 @@ export const TankopediaPersistent = new Varuna<TankopediaPersistent>(
direction: "ascending",
},
},
"tankopedia-3",
"tankopedia-4",
);
+1 -1
View File
@@ -1,2 +1,2 @@
cd packages/website
bun x --bun astro dev
bun x --bun astro dev "$@"