reze-engine 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +300 -252
- package/dist/engine.d.ts +12 -25
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +97 -312
- package/dist/graph/compile.d.ts +3 -3
- package/dist/graph/compile.d.ts.map +1 -1
- package/dist/graph/presets/body.d.ts +2 -2
- package/dist/graph/presets/body.d.ts.map +1 -1
- package/dist/graph/presets/body.js +1 -1
- package/dist/graph/presets/cloth_rough.d.ts +2 -2
- package/dist/graph/presets/cloth_rough.d.ts.map +1 -1
- package/dist/graph/presets/cloth_rough.js +1 -1
- package/dist/graph/presets/cloth_smooth.d.ts +2 -2
- package/dist/graph/presets/cloth_smooth.d.ts.map +1 -1
- package/dist/graph/presets/cloth_smooth.js +1 -1
- package/dist/graph/presets/default.d.ts +2 -2
- package/dist/graph/presets/default.d.ts.map +1 -1
- package/dist/graph/presets/default.js +13 -6
- package/dist/graph/presets/eye.d.ts +2 -2
- package/dist/graph/presets/eye.d.ts.map +1 -1
- package/dist/graph/presets/eye.js +1 -1
- package/dist/graph/presets/face.d.ts +2 -2
- package/dist/graph/presets/face.d.ts.map +1 -1
- package/dist/graph/presets/face.js +1 -1
- package/dist/graph/presets/hair.d.ts +2 -2
- package/dist/graph/presets/hair.d.ts.map +1 -1
- package/dist/graph/presets/hair.js +1 -1
- package/dist/graph/presets/metal.d.ts +2 -2
- package/dist/graph/presets/metal.d.ts.map +1 -1
- package/dist/graph/presets/metal.js +1 -1
- package/dist/graph/presets/stockings.d.ts +2 -2
- package/dist/graph/presets/stockings.d.ts.map +1 -1
- package/dist/graph/presets/stockings.js +1 -1
- package/dist/graph/registry.d.ts.map +1 -1
- package/dist/graph/registry.js +8 -0
- package/dist/graph/render-class.js +1 -1
- package/dist/graph/schema.d.ts +1 -1
- package/dist/graph/schema.d.ts.map +1 -1
- package/dist/graph/schema.js +1 -1
- package/dist/graph/style-group.d.ts +3 -3
- package/dist/graph/style-group.d.ts.map +1 -1
- package/dist/graph/style-group.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/tga-loader.d.ts +7 -0
- package/dist/tga-loader.d.ts.map +1 -0
- package/dist/tga-loader.js +154 -0
- package/package.json +2 -2
- package/src/engine.ts +4488 -4718
- package/src/graph/compile.ts +3 -3
- package/src/graph/presets/body.ts +3 -3
- package/src/graph/presets/cloth_rough.ts +3 -3
- package/src/graph/presets/cloth_smooth.ts +3 -3
- package/src/graph/presets/default.ts +15 -8
- package/src/graph/presets/eye.ts +3 -3
- package/src/graph/presets/face.ts +3 -3
- package/src/graph/presets/hair.ts +3 -3
- package/src/graph/presets/metal.ts +3 -3
- package/src/graph/presets/stockings.ts +3 -3
- package/src/graph/registry.ts +8 -0
- package/src/graph/render-class.ts +1 -1
- package/src/graph/schema.ts +2 -2
- package/src/graph/style-group.ts +4 -4
- package/src/index.ts +62 -62
- package/src/tga-loader.ts +154 -0
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
// Default material
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Default material — the neutral base used two ways: the ungrouped fallback (a material
|
|
2
|
+
// in no style group renders this) and the blank-canvas starter the editor's "New graph"
|
|
3
|
+
// begins from, so the two always agree. MMD-correct PBSDF base: diffuse texture × the
|
|
4
|
+
// PMX material diffuse color → Principled BSDF (Metallic 0, Specular 0.5, Roughness 0.5).
|
|
5
|
+
// The material-color multiply is what keeps untextured/solid-color materials from
|
|
6
|
+
// rendering white (they carry their color in material.diffuse, not a texture).
|
|
6
7
|
export const DEFAULT_GRAPH = {
|
|
7
8
|
version: 1,
|
|
8
9
|
name: "Principled BSDF",
|
|
9
10
|
tags: ["default"],
|
|
10
11
|
nodes: [
|
|
11
12
|
{ id: "tex", type: "texture" },
|
|
13
|
+
{ id: "mat", type: "material_diffuse" },
|
|
14
|
+
{ id: "base", type: "mix/multiply", inputs: { fac: 1.0 } }, // texture × material diffuse
|
|
12
15
|
{
|
|
13
16
|
id: "principled",
|
|
14
17
|
type: "principled",
|
|
15
18
|
inputs: { metallic: 0.0, specular: 0.5, roughness: 0.5, spec_clamp: 10.0, sheen: 0.0, sheen_tint: 0.0 },
|
|
16
19
|
},
|
|
17
20
|
],
|
|
18
|
-
links: [
|
|
21
|
+
links: [
|
|
22
|
+
{ from: { node: "tex", socket: "color" }, to: { node: "base", socket: "a" } },
|
|
23
|
+
{ from: { node: "mat", socket: "color" }, to: { node: "base", socket: "b" } },
|
|
24
|
+
{ from: { node: "base", socket: "color" }, to: { node: "principled", socket: "base" } },
|
|
25
|
+
],
|
|
19
26
|
output: { node: "principled", socket: "color" },
|
|
20
27
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const EYE_GRAPH:
|
|
1
|
+
import type { ShaderGraph } from "../schema";
|
|
2
|
+
export declare const EYE_GRAPH: ShaderGraph;
|
|
3
3
|
//# sourceMappingURL=eye.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eye.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/eye.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"eye.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/eye.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,eAAO,MAAM,SAAS,EAAE,WAqBvB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Eye as a
|
|
1
|
+
// Eye as a ShaderGraph — port of shaders/materials/eye.ts. The published preset
|
|
2
2
|
// author's instruction: "keep eyes in the default nodegraph, add emission 1.5".
|
|
3
3
|
// So it's the default Principled BSDF plus an Emission of the diffuse texture at
|
|
4
4
|
// 1.5× (Blender's Principled Emission socket, decomposed as a separate Emission +
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const FACE_GRAPH:
|
|
1
|
+
import type { ShaderGraph } from "../schema";
|
|
2
|
+
export declare const FACE_GRAPH: ShaderGraph;
|
|
3
3
|
//# sourceMappingURL=face.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"face.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/face.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"face.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/face.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,eAAO,MAAM,UAAU,EAAE,WA6HxB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// M_Face as a
|
|
1
|
+
// M_Face as a ShaderGraph — port of shaders/materials/face.ts (仿深空之眼 "M_Face").
|
|
2
2
|
// Toon + warm rim + dual fresnel rim + BT.601 bright-tex gate, mixed 50/50 against a
|
|
3
3
|
// Principled BSDF with noise bump. Structurally close to body, but: the toon uses the
|
|
4
4
|
// edge-AA ramp, hue tints are 0.46 (full hue_sat, not the 0.5 _id specialization),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const HAIR_GRAPH:
|
|
1
|
+
import type { ShaderGraph } from "../schema";
|
|
2
|
+
export declare const HAIR_GRAPH: ShaderGraph;
|
|
3
3
|
//# sourceMappingURL=hair.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hair.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/hair.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"hair.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/hair.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,eAAO,MAAM,UAAU,EAAE,WAmExB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// M_Hair — 仿深空之眼渲染预设v1.0_by_小绿毛猫, as a
|
|
1
|
+
// M_Hair — 仿深空之眼渲染预设v1.0_by_小绿毛猫, as a ShaderGraph. Node ids mirror the
|
|
2
2
|
// Blender node names referenced in shaders/materials/hair.ts comments; compiled with
|
|
3
3
|
// { inlineParams: true } this graph must reproduce HAIR_SHADER_WGSL's fragment body
|
|
4
4
|
// (golden test #1 — see tests/graph.test.mjs).
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const METAL_GRAPH:
|
|
1
|
+
import type { ShaderGraph } from "../schema";
|
|
2
|
+
export declare const METAL_GRAPH: ShaderGraph;
|
|
3
3
|
//# sourceMappingURL=metal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metal.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/metal.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"metal.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/metal.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,eAAO,MAAM,WAAW,EAAE,WAoDzB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// M_Metal as a
|
|
1
|
+
// M_Metal as a ShaderGraph — port of shaders/materials/metal.ts.
|
|
2
2
|
// Metallic Principled (Metallic=1, Specular=1, Roughness=0.3) with a
|
|
3
3
|
// reflection-coord voronoi driving base color (metallic sparkle), plus an NPR
|
|
4
4
|
// toon/overlay emission stack mixed at Fac=0.6967. The voronoi Color→ramp Fac
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const STOCKINGS_GRAPH:
|
|
1
|
+
import type { ShaderGraph } from "../schema";
|
|
2
|
+
export declare const STOCKINGS_GRAPH: ShaderGraph;
|
|
3
3
|
//# sourceMappingURL=stockings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stockings.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/stockings.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"stockings.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/stockings.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,eAAO,MAAM,eAAe,EAAE,WA8C7B,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// M_Stockings as a
|
|
1
|
+
// M_Stockings as a ShaderGraph — port of shaders/materials/stockings.ts.
|
|
2
2
|
// A bbox-gradient × facing-rim mask drives a Mix Shader between an HSV-boosted
|
|
3
3
|
// emission (val 5×) and a sheen Principled. The hashed-alpha discard and the
|
|
4
4
|
// alpha=1 output are slot-owned (see STOCKINGS_TEMPLATE in slots.ts) — the graph
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/graph/registry.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEzD,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,KAAK,CAAA;IACX,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,4FAA4F;IAC5F,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,yFAAyF;IACzF,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACjC,OA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;IACzF,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAC9B,2FAA2F;IAC3F,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAA;IAC/C,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACtC,CAAA;AAMD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAI1C;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,GAAG,MAAM,CAgBhE;AAED,wFAAwF;AACxF,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAIpE;AAMD,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAM1D;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKpE;AA6BD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAuPlD,CAAA"}
|
package/dist/graph/registry.js
CHANGED
|
@@ -118,6 +118,14 @@ export const NODE_REGISTRY = {
|
|
|
118
118
|
reflection: "reflect(-v, n)",
|
|
119
119
|
},
|
|
120
120
|
},
|
|
121
|
+
// PMX material's diffuse color (the authored base tint). Multiply the diffuse texture
|
|
122
|
+
// by this for the MMD-correct base — untextured materials carry their color here, so a
|
|
123
|
+
// texture-only base would render them white.
|
|
124
|
+
material_diffuse: {
|
|
125
|
+
inputs: {},
|
|
126
|
+
outputs: { color: "color" },
|
|
127
|
+
contextOutputs: { color: "material.diffuseColor" },
|
|
128
|
+
},
|
|
121
129
|
// ── Literals as nodes (for editor ergonomics; inlined literals work too) ──
|
|
122
130
|
value: { inputs: { value: F(0) }, outputs: { value: "float" }, emit: (a) => a.value },
|
|
123
131
|
rgb: { inputs: { color: C() }, outputs: { color: "color" }, emit: (a) => a.color },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Render-class + alpha-mode: the small, closed, engine-owned vocabularies that carry
|
|
2
|
-
// pass integration for a style group. A group's
|
|
2
|
+
// pass integration for a style group. A group's shader graph is pure shading; these select
|
|
3
3
|
// how the engine wires that shading into the passes. Not user-extensible — this is where
|
|
4
4
|
// rendering correctness lives (stencil, cull, draw order, alpha test). See
|
|
5
5
|
// docs/style-groups-spec.md §5.
|
package/dist/graph/schema.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/graph/schema.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAE9F,MAAM,MAAM,SAAS,GAAG;IACtB,kFAAkF;IAClF,EAAE,EAAE,MAAM,CAAA;IACV,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAA;IACZ,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IACpC;mFAC+E;IAC/E,EAAE,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAC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|
+
// ShaderGraph — a JSON-serializable graph of shading nodes, compiled to WGSL by compile.ts.
|
|
2
2
|
// Engine-space (LH, Y-up): porting a Blender graph converts coordinates at authoring
|
|
3
3
|
// time (Blender Normal Z → engine Y), the compiler never sees Blender conventions.
|
|
4
4
|
// See docs/graph-compiler-spec.md.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Diagnostic,
|
|
1
|
+
import type { Diagnostic, ShaderGraph } from "./schema";
|
|
2
2
|
import type { AlphaMode, RenderClass } from "./render-class";
|
|
3
3
|
import type { StyleSlot } from "./compile";
|
|
4
4
|
export type StyleGroup = {
|
|
@@ -9,8 +9,8 @@ export type StyleGroup = {
|
|
|
9
9
|
label?: string;
|
|
10
10
|
/** Material names in this group; each material is in AT MOST one group. */
|
|
11
11
|
materials: string[];
|
|
12
|
-
/** Pure shading (
|
|
13
|
-
graph:
|
|
12
|
+
/** Pure shading (ShaderGraph has no `slot` — integration lives here on the group). */
|
|
13
|
+
graph: ShaderGraph;
|
|
14
14
|
/** Pass-integration class: stencil/cull/draw-order. Default "auto". */
|
|
15
15
|
renderClass?: RenderClass;
|
|
16
16
|
/** Alpha-handling axis, orthogonal to renderClass. Default "opaque". */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-group.d.ts","sourceRoot":"","sources":["../../src/graph/style-group.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"style-group.d.ts","sourceRoot":"","sources":["../../src/graph/style-group.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAE1C,MAAM,MAAM,UAAU,GAAG;IACvB,wFAAwF;IACxF,EAAE,EAAE,MAAM,CAAA;IACV;2CACuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2EAA2E;IAC3E,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,sFAAsF;IACtF,KAAK,EAAE,WAAW,CAAA;IAClB,uEAAuE;IACvE,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,wEAAwE;IACxE,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,UAAU,EAAE,CAAC;IAAC,EAAE,EAAE,OAAO,CAAA;CAAE,CAAA;AAEzF,MAAM,MAAM,sBAAsB,GAAG;IACnC,sCAAsC;IACtC,EAAE,EAAE,OAAO,CAAA;IACX,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,iEAAiE;IACjE,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,kFAAkF;IAClF,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,UAAU,EAAE,CAAC;IAAC,OAAO,EAAE,SAAS,EAAE,CAAA;CAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Style groups — the user-facing unit of material styling. A group binds a set of
|
|
2
|
-
// materials to a
|
|
2
|
+
// materials to a shader graph (pure shading) plus the engine-owned pass-integration axes
|
|
3
3
|
// (renderClass + alphaMode). Each material belongs to at most one group; grouped
|
|
4
4
|
// materials render via the group's compiled-graph pipeline, ungrouped ones fall back to
|
|
5
5
|
// the hand-written preset path. See docs/style-groups-spec.md.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Engine, DEFAULT_BLOOM_OPTIONS, DEFAULT_VIEW_TRANSFORM, type EngineStats, type EngineOptions, type BloomOptions, type ViewTransformOptions, type LoadModelFromFilesOptions, type MaterialPreset, type ResolvedMaterialPreset, type MaterialPresetMap, type GizmoDragEvent, type GizmoDragCallback, type GizmoDragKind, } from "./engine";
|
|
2
2
|
export { parsePmxFolderInput, pmxFileAtRelativePath, type PmxFolderInputResult } from "./folder-upload";
|
|
3
3
|
export { compileGraph, validateGraph, assignStyleSlots, type CompileOptions, type CompileResult, type StyleSlot, } from "./graph/compile";
|
|
4
|
-
export type {
|
|
4
|
+
export type { ShaderGraph, GraphNode, GraphLink, ExposedParam, SocketValue, Diagnostic, } from "./graph/schema";
|
|
5
5
|
export { NODE_REGISTRY, type NodeSpec, type SockT } from "./graph/registry";
|
|
6
6
|
export { RENDER_CLASSES, type RenderClass, type AlphaMode, type RenderClassInfo } from "./graph/render-class";
|
|
7
7
|
export type { StyleGroup, GroupDiagnostic, ApplyStyleGroupsResult, ApplyStyleGroupResult, } from "./graph/style-group";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,aAAa,GACnB,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACvG,OAAO,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,SAAS,GACf,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.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E,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AACzC,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,YAAY,GACb,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tga-loader.d.ts","sourceRoot":"","sources":["../src/tga-loader.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAA;AAY9E,wBAAgB,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,YAAY,CAoH3D"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// Minimal TGA decoder. TGA is not a web-native format (createImageBitmap can't decode
|
|
2
|
+
// it), yet it's common in PMX assets — especially sphere maps (.spa/.sph) and eye/detail
|
|
3
|
+
// textures — so without this those materials render untextured. Produces top-left-origin
|
|
4
|
+
// RGBA8, ready for queue.writeTexture into an rgba8unorm(-srgb) texture.
|
|
5
|
+
//
|
|
6
|
+
// Handles the variants that actually appear in the wild: true-color (16/24/32), grayscale
|
|
7
|
+
// (8), and color-mapped (8-bit index), each raw or RLE-compressed, with the image
|
|
8
|
+
// descriptor's origin bits honored. Throws on malformed/unsupported input — the caller
|
|
9
|
+
// catches, logs, and falls back to the white texture (never panics the render loop).
|
|
10
|
+
// Image type byte (header offset 2).
|
|
11
|
+
var TgaType;
|
|
12
|
+
(function (TgaType) {
|
|
13
|
+
TgaType[TgaType["ColorMapped"] = 1] = "ColorMapped";
|
|
14
|
+
TgaType[TgaType["TrueColor"] = 2] = "TrueColor";
|
|
15
|
+
TgaType[TgaType["Grayscale"] = 3] = "Grayscale";
|
|
16
|
+
TgaType[TgaType["RleColorMapped"] = 9] = "RleColorMapped";
|
|
17
|
+
TgaType[TgaType["RleTrueColor"] = 10] = "RleTrueColor";
|
|
18
|
+
TgaType[TgaType["RleGrayscale"] = 11] = "RleGrayscale";
|
|
19
|
+
})(TgaType || (TgaType = {}));
|
|
20
|
+
export function decodeTga(buffer) {
|
|
21
|
+
const bytes = new Uint8Array(buffer);
|
|
22
|
+
const view = new DataView(buffer);
|
|
23
|
+
if (bytes.length < 18)
|
|
24
|
+
throw new Error("TGA too small for header");
|
|
25
|
+
const idLength = view.getUint8(0);
|
|
26
|
+
const colorMapType = view.getUint8(1);
|
|
27
|
+
const imageType = view.getUint8(2);
|
|
28
|
+
const cmapLength = view.getUint16(5, true);
|
|
29
|
+
const cmapEntryBits = view.getUint8(7);
|
|
30
|
+
const width = view.getUint16(12, true);
|
|
31
|
+
const height = view.getUint16(14, true);
|
|
32
|
+
const pixelDepth = view.getUint8(16);
|
|
33
|
+
const descriptor = view.getUint8(17);
|
|
34
|
+
if (width <= 0 || height <= 0)
|
|
35
|
+
throw new Error(`TGA bad dimensions ${width}x${height}`);
|
|
36
|
+
const rle = imageType === TgaType.RleColorMapped ||
|
|
37
|
+
imageType === TgaType.RleTrueColor ||
|
|
38
|
+
imageType === TgaType.RleGrayscale;
|
|
39
|
+
const colorMapped = imageType === TgaType.ColorMapped || imageType === TgaType.RleColorMapped;
|
|
40
|
+
const grayscale = imageType === TgaType.Grayscale || imageType === TgaType.RleGrayscale;
|
|
41
|
+
const trueColor = imageType === TgaType.TrueColor || imageType === TgaType.RleTrueColor;
|
|
42
|
+
if (!colorMapped && !grayscale && !trueColor)
|
|
43
|
+
throw new Error(`TGA unsupported image type ${imageType}`);
|
|
44
|
+
let offset = 18 + idLength;
|
|
45
|
+
// Color map (BGR/BGRA entries) → precomputed RGBA lookup.
|
|
46
|
+
let colorMap = null;
|
|
47
|
+
if (colorMapType === 1) {
|
|
48
|
+
const entryBytes = Math.ceil(cmapEntryBits / 8);
|
|
49
|
+
colorMap = new Uint8Array(cmapLength * 4);
|
|
50
|
+
for (let i = 0; i < cmapLength; i++) {
|
|
51
|
+
const [r, g, b, a] = unpackColor(bytes, offset + i * entryBytes, cmapEntryBits);
|
|
52
|
+
colorMap.set([r, g, b, a], i * 4);
|
|
53
|
+
}
|
|
54
|
+
offset += cmapLength * entryBytes;
|
|
55
|
+
}
|
|
56
|
+
else if (colorMapped) {
|
|
57
|
+
throw new Error("TGA color-mapped image without a color map");
|
|
58
|
+
}
|
|
59
|
+
// Bytes per stored element (index byte for color-mapped, else pixel bytes).
|
|
60
|
+
const elemBits = colorMapped ? pixelDepth : pixelDepth;
|
|
61
|
+
const elemBytes = Math.ceil(elemBits / 8);
|
|
62
|
+
const pixelCount = width * height;
|
|
63
|
+
// Decode the (possibly RLE) element stream into one element per pixel, file order.
|
|
64
|
+
const elements = new Uint8Array(pixelCount * elemBytes);
|
|
65
|
+
if (rle) {
|
|
66
|
+
let out = 0;
|
|
67
|
+
let src = offset;
|
|
68
|
+
while (out < elements.length) {
|
|
69
|
+
if (src >= bytes.length)
|
|
70
|
+
throw new Error("TGA RLE stream truncated");
|
|
71
|
+
const packet = bytes[src++];
|
|
72
|
+
const count = (packet & 0x7f) + 1;
|
|
73
|
+
if (packet & 0x80) {
|
|
74
|
+
// RLE packet: one element repeated `count` times.
|
|
75
|
+
if (src + elemBytes > bytes.length)
|
|
76
|
+
throw new Error("TGA RLE packet truncated");
|
|
77
|
+
for (let i = 0; i < count && out < elements.length; i++) {
|
|
78
|
+
elements.set(bytes.subarray(src, src + elemBytes), out);
|
|
79
|
+
out += elemBytes;
|
|
80
|
+
}
|
|
81
|
+
src += elemBytes;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
// Raw packet: `count` elements follow.
|
|
85
|
+
const span = count * elemBytes;
|
|
86
|
+
if (src + span > bytes.length)
|
|
87
|
+
throw new Error("TGA raw packet truncated");
|
|
88
|
+
elements.set(bytes.subarray(src, src + span), out);
|
|
89
|
+
out += span;
|
|
90
|
+
src += span;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
const span = pixelCount * elemBytes;
|
|
96
|
+
if (offset + span > bytes.length)
|
|
97
|
+
throw new Error("TGA pixel data truncated");
|
|
98
|
+
elements.set(bytes.subarray(offset, offset + span), 0);
|
|
99
|
+
}
|
|
100
|
+
// Convert elements → RGBA in file order.
|
|
101
|
+
const linear = new Uint8Array(pixelCount * 4);
|
|
102
|
+
for (let p = 0; p < pixelCount; p++) {
|
|
103
|
+
let rgba;
|
|
104
|
+
if (colorMapped) {
|
|
105
|
+
const index = elements[p]; // 8-bit index (pixelDepth 8)
|
|
106
|
+
const c = index * 4;
|
|
107
|
+
rgba = colorMap ? [colorMap[c], colorMap[c + 1], colorMap[c + 2], colorMap[c + 3]] : [0, 0, 0, 255];
|
|
108
|
+
}
|
|
109
|
+
else if (grayscale) {
|
|
110
|
+
const g = elements[p * elemBytes];
|
|
111
|
+
rgba = [g, g, g, 255];
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
rgba = unpackColor(elements, p * elemBytes, pixelDepth);
|
|
115
|
+
}
|
|
116
|
+
linear.set(rgba, p * 4);
|
|
117
|
+
}
|
|
118
|
+
// Honor origin bits: bit5 set → top-to-bottom (no flip); clear → bottom-to-top.
|
|
119
|
+
// bit4 set → right-to-left. Output is always top-left origin for GPU upload.
|
|
120
|
+
const flipY = (descriptor & 0x20) === 0;
|
|
121
|
+
const flipX = (descriptor & 0x10) !== 0;
|
|
122
|
+
if (!flipX && !flipY)
|
|
123
|
+
return { width, height, rgba: linear };
|
|
124
|
+
const rgba = new Uint8Array(pixelCount * 4);
|
|
125
|
+
for (let y = 0; y < height; y++) {
|
|
126
|
+
const sy = flipY ? height - 1 - y : y;
|
|
127
|
+
for (let x = 0; x < width; x++) {
|
|
128
|
+
const sx = flipX ? width - 1 - x : x;
|
|
129
|
+
const src = (sy * width + sx) * 4;
|
|
130
|
+
const dst = (y * width + x) * 4;
|
|
131
|
+
rgba[dst] = linear[src];
|
|
132
|
+
rgba[dst + 1] = linear[src + 1];
|
|
133
|
+
rgba[dst + 2] = linear[src + 2];
|
|
134
|
+
rgba[dst + 3] = linear[src + 3];
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return { width, height, rgba };
|
|
138
|
+
}
|
|
139
|
+
// Unpack one true-color element (16/24/32-bit, stored BGR[A]) to RGBA8.
|
|
140
|
+
function unpackColor(src, o, bits) {
|
|
141
|
+
if (bits === 32)
|
|
142
|
+
return [src[o + 2], src[o + 1], src[o], src[o + 3]];
|
|
143
|
+
if (bits === 24)
|
|
144
|
+
return [src[o + 2], src[o + 1], src[o], 255];
|
|
145
|
+
if (bits === 16 || bits === 15) {
|
|
146
|
+
// 1-5-5-5: bit15 = attribute, then 5 red, 5 green, 5 blue (little-endian).
|
|
147
|
+
const val = src[o] | (src[o + 1] << 8);
|
|
148
|
+
const r = ((val >> 10) & 0x1f) * 255;
|
|
149
|
+
const g = ((val >> 5) & 0x1f) * 255;
|
|
150
|
+
const b = (val & 0x1f) * 255;
|
|
151
|
+
return [Math.round(r / 31), Math.round(g / 31), Math.round(b / 31), 255];
|
|
152
|
+
}
|
|
153
|
+
throw new Error(`TGA unsupported pixel depth ${bits}`);
|
|
154
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reze-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "A lightweight WebGPU engine for real-time 3D MMD/PMX model rendering",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"build": "tsc",
|
|
24
24
|
"dev": "tsc --watch",
|
|
25
25
|
"test": "node --import ./tests/register.mjs --test tests/*.test.mjs",
|
|
26
|
-
"prepublishOnly": "npm run build"
|
|
26
|
+
"prepublishOnly": "cp ../README.md ./README.md && npm run build"
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|
|
29
29
|
"webgpu",
|