mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-05 07:43:49 +01:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e2585e605 | ||
|
|
eda6eb280f | ||
|
|
9b81166114 | ||
|
|
b9f5d13415 | ||
|
|
e48f4e31c8 | ||
|
|
11c2edcfff |
No files matched your search
@@ -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
|
||||
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "blitzkit",
|
||||
"version": "1.33.0",
|
||||
"version": "1.33.2",
|
||||
"license": "BlitzKit License",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
|
||||
@@ -266,7 +266,7 @@ export type Component =
|
||||
}
|
||||
| {
|
||||
"comp.typename": "MotionComponent";
|
||||
"motion.filepath": string;
|
||||
"motion.filepath"?: string;
|
||||
"motion.playbackRate": number;
|
||||
"simpleMotion.repeatsCount": number;
|
||||
}
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
precision mediump float;
|
||||
|
||||
varying vec3 vNormal;
|
||||
varying vec3 vViewPosition;
|
||||
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
precision mediump float;
|
||||
|
||||
varying vec3 vNormal;
|
||||
varying vec3 vViewPosition;
|
||||
varying float vThickness;
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
precision mediump float;
|
||||
|
||||
uniform float thickness;
|
||||
uniform float penetration;
|
||||
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
precision mediump float;
|
||||
|
||||
#include <batching_pars_vertex>
|
||||
#include <clipping_planes_pars_vertex>
|
||||
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
precision mediump float;
|
||||
|
||||
varying vec3 vNormal;
|
||||
varying vec3 vViewPosition;
|
||||
|
||||
|
||||
-2
@@ -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,2 +1,2 @@
|
||||
cd packages/website
|
||||
bun x --bun astro dev
|
||||
bun x --bun astro dev "$@"
|
||||
Reference in new issue
Block a user