reze-engine 0.24.0 → 0.25.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/dist/engine.d.ts +49 -0
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +318 -31
- package/dist/gpu-profile.d.ts +19 -0
- package/dist/gpu-profile.d.ts.map +1 -0
- package/dist/gpu-profile.js +120 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/physics/profile.d.ts +18 -0
- package/dist/physics/profile.d.ts.map +1 -0
- package/dist/physics/profile.js +44 -0
- package/dist/shaders/passes/composite.d.ts +23 -1
- package/dist/shaders/passes/composite.d.ts.map +1 -1
- package/dist/shaders/passes/composite.js +62 -16
- package/dist/shaders/passes/ground.d.ts +1 -1
- package/dist/shaders/passes/ground.d.ts.map +1 -1
- package/dist/shaders/passes/ground.js +8 -0
- package/package.json +1 -1
- package/src/engine.ts +346 -32
- package/src/index.ts +2 -0
- package/src/shaders/passes/composite.ts +89 -16
- package/src/shaders/passes/ground.ts +8 -0
- package/dist/physics-debug.d.ts +0 -30
- package/dist/physics-debug.d.ts.map +0 -1
- package/dist/physics-debug.js +0 -526
- package/dist/shaders/passes/physics-debug.d.ts +0 -2
- package/dist/shaders/passes/physics-debug.d.ts.map +0 -1
- package/dist/shaders/passes/physics-debug.js +0 -69
package/dist/engine.d.ts
CHANGED
|
@@ -34,6 +34,19 @@ export type SunOptions = {
|
|
|
34
34
|
/** Direction sunlight travels (points FROM sun TO scene, Blender: -light.rotation.Z). */
|
|
35
35
|
direction?: Vec3;
|
|
36
36
|
};
|
|
37
|
+
/** A background-effect param: number → f32, vector-like → vec3f (see
|
|
38
|
+
* setBackgroundEffect). Structural {x,y,z} rather than the Vec3 class so
|
|
39
|
+
* JSON-derived values (a shared scene document's params) pass straight in. */
|
|
40
|
+
export type BackgroundEffectParamValue = number | {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
z: number;
|
|
44
|
+
};
|
|
45
|
+
export type BackgroundEffectResult = {
|
|
46
|
+
ok: boolean;
|
|
47
|
+
/** Compile/validation errors, line:col relative to the USER's WGSL. */
|
|
48
|
+
diagnostics: string[];
|
|
49
|
+
};
|
|
37
50
|
export type CameraOptions = {
|
|
38
51
|
/** Orbit distance from target. */
|
|
39
52
|
distance?: number;
|
|
@@ -221,6 +234,12 @@ export declare class Engine {
|
|
|
221
234
|
private backdropEquirectView;
|
|
222
235
|
private fallbackEquirectTexture;
|
|
223
236
|
private fallbackEquirectView;
|
|
237
|
+
private backgroundEffect;
|
|
238
|
+
/** Bound at composite binding 7 when no effect (or a param-less one) is set. */
|
|
239
|
+
private bgParamsDummyBuffer;
|
|
240
|
+
private compositePipelineLayout;
|
|
241
|
+
/** time=0 origin for the active effect — reset each setBackgroundEffect. */
|
|
242
|
+
private bgEffectEpochMs;
|
|
224
243
|
private compositeBloomView;
|
|
225
244
|
private bloomSampler;
|
|
226
245
|
private bloomBlitUniformBuffer;
|
|
@@ -279,6 +298,7 @@ export declare class Engine {
|
|
|
279
298
|
private materialSampler;
|
|
280
299
|
private fallbackMaterialTexture;
|
|
281
300
|
private textureCache;
|
|
301
|
+
private textureAlphaCache;
|
|
282
302
|
private mipBlitPipeline;
|
|
283
303
|
private mipBlitSampler;
|
|
284
304
|
private _nextDefaultModelId;
|
|
@@ -327,6 +347,35 @@ export declare class Engine {
|
|
|
327
347
|
* color, or transparency, takes over again).
|
|
328
348
|
*/
|
|
329
349
|
setBackdropEquirect(source: ImageBitmap | HTMLImageElement | HTMLCanvasElement | null): void;
|
|
350
|
+
private makeCompositePipeline;
|
|
351
|
+
/**
|
|
352
|
+
* Install a WGSL background effect (shadertoy-style) as a LAYER between the
|
|
353
|
+
* base background and the scene: rendered per-pixel in the composite pass and
|
|
354
|
+
* over-composited onto whichever base is active (solid color, 360 equirect,
|
|
355
|
+
* or transparency) — its alpha lets the base show through, so a starfield is
|
|
356
|
+
* stars over the user's background color. Display-space: never affects
|
|
357
|
+
* lighting, bloom, or tonemapping, and is captured by offline export like any
|
|
358
|
+
* background.
|
|
359
|
+
*
|
|
360
|
+
* `wgsl` must define:
|
|
361
|
+
*
|
|
362
|
+
* fn background(ray: vec3f, uv: vec2f, time: f32) -> vec4f
|
|
363
|
+
*
|
|
364
|
+
* where `ray` is the pixel's normalized world-space view direction (LH, +Z
|
|
365
|
+
* forward — what the skybox samples by), `uv` is 0..1 bottom-left origin,
|
|
366
|
+
* `time` is seconds since apply, and `bgResolution()` gives the canvas size.
|
|
367
|
+
* Return sRGB + alpha. Declared `params` arrive as `params.<name>` (number →
|
|
368
|
+
* f32, Vec3 → vec3f) and are later tweaked without recompiling via
|
|
369
|
+
* setBackgroundEffectParam.
|
|
370
|
+
*
|
|
371
|
+
* Compiles off the hot path (async pipelines): on failure the previous
|
|
372
|
+
* background is KEPT and diagnostics are returned with line numbers relative
|
|
373
|
+
* to the user's WGSL. Pass null to remove the effect.
|
|
374
|
+
*/
|
|
375
|
+
setBackgroundEffect(wgsl: string | null, params?: Record<string, BackgroundEffectParamValue>): Promise<BackgroundEffectResult>;
|
|
376
|
+
/** Write one background-effect param (declared at setBackgroundEffect) — a
|
|
377
|
+
* uniform write, no recompile; the instant tier, like setStyleParam. */
|
|
378
|
+
setBackgroundEffectParam(name: string, value: BackgroundEffectParamValue): void;
|
|
330
379
|
/** Patch bloom; GPU uniforms update immediately if `init()` has run. */
|
|
331
380
|
setBloomOptions(patch: Partial<BloomOptions>): void;
|
|
332
381
|
private writeBloomUniforms;
|
package/dist/engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,IAAI,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AACzC,OAAO,EAAE,KAAK,EAAiB,MAAM,SAAS,CAAA;AAO9C,OAAO,EAQL,KAAK,WAAW,EACjB,MAAM,g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;CA0CpB"}
|
package/dist/engine.js
CHANGED
|
@@ -15,7 +15,7 @@ import { OUTLINE_SHADER_WGSL } from "./shaders/passes/outline";
|
|
|
15
15
|
import { SELECTION_MASK_SHADER_WGSL, SELECTION_EDGE_SHADER_WGSL } from "./shaders/passes/selection";
|
|
16
16
|
import { GIZMO_SHADER_WGSL } from "./shaders/passes/gizmo";
|
|
17
17
|
import { BLOOM_BLIT_SHADER_WGSL, BLOOM_DOWNSAMPLE_SHADER_WGSL, BLOOM_UPSAMPLE_SHADER_WGSL, } from "./shaders/passes/bloom";
|
|
18
|
-
import {
|
|
18
|
+
import { buildCompositeShader } from "./shaders/passes/composite";
|
|
19
19
|
import { PICK_SHADER_WGSL } from "./shaders/passes/pick";
|
|
20
20
|
import { MIPMAP_BLIT_SHADER_WGSL } from "./shaders/passes/mipmap";
|
|
21
21
|
import { compileGraph } from "./graph/compile";
|
|
@@ -42,7 +42,7 @@ const PRESET_NAME_HINTS = [
|
|
|
42
42
|
// share the face material family. Bare 口 is omitted — it collides with 袖口 (cuff).
|
|
43
43
|
[
|
|
44
44
|
"face",
|
|
45
|
-
["顔", "颜", "脸", "かお", "face", "舌", "tongue", "牙", "牙齿", "歯", "teeth", "tooth", "口腔", "口内", "mouth", "嘴", "歯茎", "gums"],
|
|
45
|
+
["顔", "颜", "顏", "脸", "臉", "かお", "face", "舌", "tongue", "牙", "牙齿", "歯", "teeth", "tooth", "口腔", "口内", "mouth", "嘴", "歯茎", "gums"],
|
|
46
46
|
],
|
|
47
47
|
["hair", ["前髪", "後髪", "髪", "髮", "头发", "頭髪", "もみあげ", "アホ毛", "ヘア", "hair", "ahoge", "bang"]],
|
|
48
48
|
["body", ["肌", "皮肤", "skin"]],
|
|
@@ -147,6 +147,77 @@ export const DEFAULT_ENGINE_OPTIONS = {
|
|
|
147
147
|
camera: { distance: 26.6, target: new Vec3(0, 12.5, 0), fov: Math.PI / 4 },
|
|
148
148
|
onRaycast: undefined,
|
|
149
149
|
};
|
|
150
|
+
// ── Sheer-material detection ──────────────────────────────────────────────────
|
|
151
|
+
// PMX carries no "translucent" flag: a see-through veil usually has diffuse
|
|
152
|
+
// alpha 1.0 and does its transparency entirely in the TEXTURE's alpha channel.
|
|
153
|
+
// Classifying by material alpha alone put such cloth in the opaque bucket,
|
|
154
|
+
// where it draws in PMX order with depth writes — anything the engine draws
|
|
155
|
+
// after it (the hair render-class draws LAST for the eye-stencil effect) got
|
|
156
|
+
// depth-rejected behind the veil, so you saw the body through it but not the
|
|
157
|
+
// hair. These helpers measure a material's real coverage by sampling the
|
|
158
|
+
// texture's alpha at the material's own triangle CENTROIDS — centroids, not
|
|
159
|
+
// vertices, because hair-card corners sit in transparent texture margins and
|
|
160
|
+
// vertex sampling would misclassify hair (which must stay opaque-bucket for
|
|
161
|
+
// stencil interplay and shadows).
|
|
162
|
+
/** Downsampled alpha plane of a decoded texture (≤128², nearest-sampled). */
|
|
163
|
+
function buildAlphaSampler(source, rgba, width, height) {
|
|
164
|
+
try {
|
|
165
|
+
const w = Math.max(1, Math.min(128, width));
|
|
166
|
+
const h = Math.max(1, Math.min(128, height));
|
|
167
|
+
const canvas = new OffscreenCanvas(w, h);
|
|
168
|
+
const cx = canvas.getContext("2d", { willReadFrequently: true });
|
|
169
|
+
if (!cx)
|
|
170
|
+
return null;
|
|
171
|
+
if (source) {
|
|
172
|
+
cx.drawImage(source, 0, 0, w, h);
|
|
173
|
+
}
|
|
174
|
+
else if (rgba) {
|
|
175
|
+
const tmp = new OffscreenCanvas(width, height);
|
|
176
|
+
const tcx = tmp.getContext("2d");
|
|
177
|
+
if (!tcx)
|
|
178
|
+
return null;
|
|
179
|
+
tcx.putImageData(new ImageData(new Uint8ClampedArray(rgba), width, height), 0, 0);
|
|
180
|
+
cx.drawImage(tmp, 0, 0, w, h);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
const img = cx.getImageData(0, 0, w, h).data;
|
|
186
|
+
const a = new Uint8ClampedArray(w * h);
|
|
187
|
+
for (let i = 0; i < w * h; i++)
|
|
188
|
+
a[i] = img[i * 4 + 3];
|
|
189
|
+
return { a, w, h };
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
/** Average texture alpha over ≤400 of the material's triangle centroids —
|
|
196
|
+
* below the threshold the material renders as a transparent-bucket draw. */
|
|
197
|
+
const SHEER_ALPHA_THRESHOLD = 0.7;
|
|
198
|
+
function materialIsSheer(verts, indices, firstIndex, count, sampler) {
|
|
199
|
+
if (!sampler)
|
|
200
|
+
return false;
|
|
201
|
+
const triCount = Math.floor(count / 3);
|
|
202
|
+
if (triCount === 0)
|
|
203
|
+
return false;
|
|
204
|
+
const step = Math.max(1, Math.floor(triCount / 400));
|
|
205
|
+
let sum = 0;
|
|
206
|
+
let n = 0;
|
|
207
|
+
for (let t = 0; t < triCount; t += step) {
|
|
208
|
+
const i0 = indices[firstIndex + t * 3];
|
|
209
|
+
const i1 = indices[firstIndex + t * 3 + 1];
|
|
210
|
+
const i2 = indices[firstIndex + t * 3 + 2];
|
|
211
|
+
const u = (verts[i0 * 8 + 6] + verts[i1 * 8 + 6] + verts[i2 * 8 + 6]) / 3;
|
|
212
|
+
const v = (verts[i0 * 8 + 7] + verts[i1 * 8 + 7] + verts[i2 * 8 + 7]) / 3;
|
|
213
|
+
// Wrap (MMD UVs may tile), then nearest-sample the downsampled plane.
|
|
214
|
+
const x = Math.min(sampler.w - 1, Math.max(0, Math.floor((u - Math.floor(u)) * sampler.w)));
|
|
215
|
+
const y = Math.min(sampler.h - 1, Math.max(0, Math.floor((v - Math.floor(v)) * sampler.h)));
|
|
216
|
+
sum += sampler.a[y * sampler.w + x];
|
|
217
|
+
n++;
|
|
218
|
+
}
|
|
219
|
+
return n > 0 && sum / n < SHEER_ALPHA_THRESHOLD * 255;
|
|
220
|
+
}
|
|
150
221
|
export class Engine {
|
|
151
222
|
static getInstance() {
|
|
152
223
|
if (!Engine.instance) {
|
|
@@ -188,12 +259,19 @@ export class Engine {
|
|
|
188
259
|
// unchanged).
|
|
189
260
|
this.hdrFormat = "rgba16float";
|
|
190
261
|
// [exposure, invGamma, _, _, bloomTint.x, bloomTint.y, bloomTint.z, bloomIntensity]
|
|
191
|
-
this.compositeUniformData = new Float32Array(
|
|
262
|
+
this.compositeUniformData = new Float32Array(28);
|
|
192
263
|
/** Composite background (display-space sRGB 0–1) — null = transparent canvas. */
|
|
193
264
|
this.backgroundColor = null;
|
|
194
265
|
// 360 backdrop (equirectangular skybox, sampled by view ray in composite).
|
|
195
266
|
this.backdropEquirectTexture = null;
|
|
196
267
|
this.backdropEquirectView = null;
|
|
268
|
+
// User WGSL background effect (background mode 3, setBackgroundEffect). The
|
|
269
|
+
// composite pipelines are REBUILT with the user code injected; params live in
|
|
270
|
+
// their own uniform buffer so setBackgroundEffectParam is a write, not a
|
|
271
|
+
// recompile (the same instant tier as setStyleParam).
|
|
272
|
+
this.backgroundEffect = null;
|
|
273
|
+
/** time=0 origin for the active effect — reset each setBackgroundEffect. */
|
|
274
|
+
this.bgEffectEpochMs = 0;
|
|
197
275
|
this.compositeBloomView = null;
|
|
198
276
|
this.bloomBlitUniformData = new Float32Array(4);
|
|
199
277
|
this.bloomUpsampleUniformData = new Float32Array(4);
|
|
@@ -210,6 +288,11 @@ export class Engine {
|
|
|
210
288
|
this.pendingPick = null;
|
|
211
289
|
this.modelInstances = new Map();
|
|
212
290
|
this.textureCache = new Map();
|
|
291
|
+
// Downsampled CPU alpha channel per texture (≤128², ~16KB) — kept so materials
|
|
292
|
+
// can be classified as SHEER at load by sampling alpha at their own UVs (the
|
|
293
|
+
// GPU texture can't be read back cheaply, and PMX diffuse alpha is usually 1.0
|
|
294
|
+
// even for see-through cloth: the translucency lives in the texture).
|
|
295
|
+
this.textureAlphaCache = new Map();
|
|
213
296
|
this.mipBlitPipeline = null;
|
|
214
297
|
this.mipBlitSampler = null;
|
|
215
298
|
this._nextDefaultModelId = 0;
|
|
@@ -537,7 +620,12 @@ export class Engine {
|
|
|
537
620
|
u[8] = bg?.x ?? 0;
|
|
538
621
|
u[9] = bg?.y ?? 0;
|
|
539
622
|
u[10] = bg?.z ?? 0;
|
|
623
|
+
// Base-layer mode; a user effect is a separate LAYER flagged at u[25] and
|
|
624
|
+
// over-composited onto whichever base is active.
|
|
540
625
|
u[11] = this.backdropEquirectView ? 2 : bg ? 1 : 0;
|
|
626
|
+
u[25] = this.backgroundEffect ? 1 : 0;
|
|
627
|
+
u[26] = this.canvas.width;
|
|
628
|
+
u[27] = this.canvas.height;
|
|
541
629
|
this.device.queue.writeBuffer(this.compositeUniformBuffer, 0, u);
|
|
542
630
|
}
|
|
543
631
|
/**
|
|
@@ -566,6 +654,7 @@ export class Engine {
|
|
|
566
654
|
{ binding: 4, resource: this.maskResolveView },
|
|
567
655
|
{ binding: 5, resource: this.filmicLutView },
|
|
568
656
|
{ binding: 6, resource: this.backdropEquirectView ?? this.fallbackEquirectView },
|
|
657
|
+
{ binding: 7, resource: { buffer: this.backgroundEffect?.paramsBuffer ?? this.bgParamsDummyBuffer } },
|
|
569
658
|
],
|
|
570
659
|
});
|
|
571
660
|
}
|
|
@@ -613,6 +702,165 @@ export class Engine {
|
|
|
613
702
|
if (this.device && this.compositeUniformBuffer)
|
|
614
703
|
this.writeCompositeViewUniforms();
|
|
615
704
|
}
|
|
705
|
+
makeCompositePipeline(module, applyGamma, label) {
|
|
706
|
+
return this.device.createRenderPipeline({
|
|
707
|
+
label,
|
|
708
|
+
layout: this.compositePipelineLayout,
|
|
709
|
+
vertex: { module, entryPoint: "vs" },
|
|
710
|
+
fragment: {
|
|
711
|
+
module,
|
|
712
|
+
entryPoint: "fs",
|
|
713
|
+
constants: { APPLY_GAMMA: applyGamma ? 1 : 0 },
|
|
714
|
+
targets: [{ format: this.presentationFormat }],
|
|
715
|
+
},
|
|
716
|
+
primitive: { topology: "triangle-list" },
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* Install a WGSL background effect (shadertoy-style) as a LAYER between the
|
|
721
|
+
* base background and the scene: rendered per-pixel in the composite pass and
|
|
722
|
+
* over-composited onto whichever base is active (solid color, 360 equirect,
|
|
723
|
+
* or transparency) — its alpha lets the base show through, so a starfield is
|
|
724
|
+
* stars over the user's background color. Display-space: never affects
|
|
725
|
+
* lighting, bloom, or tonemapping, and is captured by offline export like any
|
|
726
|
+
* background.
|
|
727
|
+
*
|
|
728
|
+
* `wgsl` must define:
|
|
729
|
+
*
|
|
730
|
+
* fn background(ray: vec3f, uv: vec2f, time: f32) -> vec4f
|
|
731
|
+
*
|
|
732
|
+
* where `ray` is the pixel's normalized world-space view direction (LH, +Z
|
|
733
|
+
* forward — what the skybox samples by), `uv` is 0..1 bottom-left origin,
|
|
734
|
+
* `time` is seconds since apply, and `bgResolution()` gives the canvas size.
|
|
735
|
+
* Return sRGB + alpha. Declared `params` arrive as `params.<name>` (number →
|
|
736
|
+
* f32, Vec3 → vec3f) and are later tweaked without recompiling via
|
|
737
|
+
* setBackgroundEffectParam.
|
|
738
|
+
*
|
|
739
|
+
* Compiles off the hot path (async pipelines): on failure the previous
|
|
740
|
+
* background is KEPT and diagnostics are returned with line numbers relative
|
|
741
|
+
* to the user's WGSL. Pass null to remove the effect.
|
|
742
|
+
*/
|
|
743
|
+
async setBackgroundEffect(wgsl, params) {
|
|
744
|
+
if (!this.device)
|
|
745
|
+
return { ok: false, diagnostics: ["setBackgroundEffect requires init() to have run"] };
|
|
746
|
+
if (wgsl === null) {
|
|
747
|
+
this.backgroundEffect?.paramsBuffer?.destroy();
|
|
748
|
+
this.backgroundEffect = null;
|
|
749
|
+
const module = this.device.createShaderModule({ label: "composite shader", code: buildCompositeShader(null) });
|
|
750
|
+
this.compositePipelineIdentity = this.makeCompositePipeline(module, false, "composite pipeline (gamma=1)");
|
|
751
|
+
this.compositePipelineGamma = this.makeCompositePipeline(module, true, "composite pipeline (gamma!=1)");
|
|
752
|
+
this.rebuildCompositeBindGroup();
|
|
753
|
+
this.writeCompositeViewUniforms();
|
|
754
|
+
return { ok: true, diagnostics: [] };
|
|
755
|
+
}
|
|
756
|
+
// ── Params: codegen a WGSL struct and mirror its uniform layout on the CPU.
|
|
757
|
+
// Fields are emitted in declaration order; offsets follow WGSL's natural
|
|
758
|
+
// uniform rules (f32 align 4, vec3f align 16 size 12), computed identically
|
|
759
|
+
// on both sides so no reordering is needed.
|
|
760
|
+
const entries = Object.entries(params ?? {});
|
|
761
|
+
const layout = new Map();
|
|
762
|
+
const fields = [];
|
|
763
|
+
let cursor = 0;
|
|
764
|
+
for (const [name, value] of entries) {
|
|
765
|
+
if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(name)) {
|
|
766
|
+
return { ok: false, diagnostics: [`invalid param name "${name}" (must be a WGSL identifier)`] };
|
|
767
|
+
}
|
|
768
|
+
const isVec = typeof value !== "number";
|
|
769
|
+
const align = isVec ? 16 : 4;
|
|
770
|
+
const offset = Math.ceil(cursor / align) * align;
|
|
771
|
+
layout.set(name, { offset: offset / 4, comps: isVec ? 3 : 1 });
|
|
772
|
+
fields.push(` ${name}: ${isVec ? "vec3f" : "f32"},`);
|
|
773
|
+
cursor = offset + (isVec ? 12 : 4);
|
|
774
|
+
}
|
|
775
|
+
const paramsData = new Float32Array(Math.max(4, Math.ceil(cursor / 16) * 4));
|
|
776
|
+
for (const [name, value] of entries) {
|
|
777
|
+
const slot = layout.get(name);
|
|
778
|
+
if (typeof value === "number")
|
|
779
|
+
paramsData[slot.offset] = value;
|
|
780
|
+
else {
|
|
781
|
+
paramsData[slot.offset] = value.x;
|
|
782
|
+
paramsData[slot.offset + 1] = value.y;
|
|
783
|
+
paramsData[slot.offset + 2] = value.z;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
const paramsDecl = entries.length
|
|
787
|
+
? `struct BgParams {\n${fields.join("\n")}\n}\n@group(0) @binding(7) var<uniform> params: BgParams;\n`
|
|
788
|
+
: "";
|
|
789
|
+
// ── Compile with validation captured, not thrown at the console. Line
|
|
790
|
+
// numbers in diagnostics are rebased to the USER's source.
|
|
791
|
+
const source = buildCompositeShader({ wgsl, paramsDecl });
|
|
792
|
+
const userLineOffset = source.slice(0, source.indexOf(wgsl)).split("\n").length - 1;
|
|
793
|
+
this.device.pushErrorScope("validation");
|
|
794
|
+
const module = this.device.createShaderModule({ label: "composite shader (bg effect)", code: source });
|
|
795
|
+
const info = await module.getCompilationInfo();
|
|
796
|
+
const scopeErr = await this.device.popErrorScope();
|
|
797
|
+
const diagnostics = info.messages
|
|
798
|
+
.filter((m) => m.type === "error")
|
|
799
|
+
.map((m) => `${Math.max(0, m.lineNum - userLineOffset)}:${m.linePos} ${m.message}`);
|
|
800
|
+
if (diagnostics.length === 0 && scopeErr)
|
|
801
|
+
diagnostics.push(scopeErr.message);
|
|
802
|
+
if (diagnostics.length > 0)
|
|
803
|
+
return { ok: false, diagnostics };
|
|
804
|
+
let identity;
|
|
805
|
+
let gamma;
|
|
806
|
+
try {
|
|
807
|
+
const make = (applyGamma, label) => this.device.createRenderPipelineAsync({
|
|
808
|
+
label,
|
|
809
|
+
layout: this.compositePipelineLayout,
|
|
810
|
+
vertex: { module, entryPoint: "vs" },
|
|
811
|
+
fragment: {
|
|
812
|
+
module,
|
|
813
|
+
entryPoint: "fs",
|
|
814
|
+
constants: { APPLY_GAMMA: applyGamma ? 1 : 0 },
|
|
815
|
+
targets: [{ format: this.presentationFormat }],
|
|
816
|
+
},
|
|
817
|
+
primitive: { topology: "triangle-list" },
|
|
818
|
+
});
|
|
819
|
+
[identity, gamma] = await Promise.all([
|
|
820
|
+
make(false, "composite pipeline (bg effect, gamma=1)"),
|
|
821
|
+
make(true, "composite pipeline (bg effect, gamma!=1)"),
|
|
822
|
+
]);
|
|
823
|
+
}
|
|
824
|
+
catch (e) {
|
|
825
|
+
return { ok: false, diagnostics: [e instanceof Error ? e.message : String(e)] };
|
|
826
|
+
}
|
|
827
|
+
// ── Swap — only now does the old effect (and its params buffer) go away.
|
|
828
|
+
this.backgroundEffect?.paramsBuffer?.destroy();
|
|
829
|
+
let paramsBuffer = null;
|
|
830
|
+
if (entries.length) {
|
|
831
|
+
paramsBuffer = this.device.createBuffer({
|
|
832
|
+
label: "bg effect params",
|
|
833
|
+
size: paramsData.byteLength,
|
|
834
|
+
usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
|
|
835
|
+
});
|
|
836
|
+
this.device.queue.writeBuffer(paramsBuffer, 0, paramsData);
|
|
837
|
+
}
|
|
838
|
+
this.backgroundEffect = { wgsl, paramLayout: layout, paramsBuffer, paramsData };
|
|
839
|
+
this.compositePipelineIdentity = identity;
|
|
840
|
+
this.compositePipelineGamma = gamma;
|
|
841
|
+
this.bgEffectEpochMs = performance.now();
|
|
842
|
+
this.rebuildCompositeBindGroup();
|
|
843
|
+
this.writeCompositeViewUniforms();
|
|
844
|
+
return { ok: true, diagnostics: [] };
|
|
845
|
+
}
|
|
846
|
+
/** Write one background-effect param (declared at setBackgroundEffect) — a
|
|
847
|
+
* uniform write, no recompile; the instant tier, like setStyleParam. */
|
|
848
|
+
setBackgroundEffectParam(name, value) {
|
|
849
|
+
const fx = this.backgroundEffect;
|
|
850
|
+
if (!fx || !fx.paramsBuffer)
|
|
851
|
+
return;
|
|
852
|
+
const slot = fx.paramLayout.get(name);
|
|
853
|
+
if (!slot)
|
|
854
|
+
return;
|
|
855
|
+
if (typeof value === "number")
|
|
856
|
+
fx.paramsData[slot.offset] = value;
|
|
857
|
+
else {
|
|
858
|
+
fx.paramsData[slot.offset] = value.x;
|
|
859
|
+
fx.paramsData[slot.offset + 1] = value.y;
|
|
860
|
+
fx.paramsData[slot.offset + 2] = value.z;
|
|
861
|
+
}
|
|
862
|
+
this.device.queue.writeBuffer(fx.paramsBuffer, 0, fx.paramsData);
|
|
863
|
+
}
|
|
616
864
|
/** Patch bloom; GPU uniforms update immediately if `init()` has run. */
|
|
617
865
|
setBloomOptions(patch) {
|
|
618
866
|
const b = this.bloomSettings;
|
|
@@ -1350,9 +1598,15 @@ export class Engine {
|
|
|
1350
1598
|
// mirroring EEVEE where bloom color/intensity are combine-stage params, not prefilter).
|
|
1351
1599
|
this.compositeUniformBuffer = this.device.createBuffer({
|
|
1352
1600
|
label: "composite view uniforms",
|
|
1353
|
-
//
|
|
1354
|
-
// (bg rgb, mode) · camera right/up/forward basis for the 360 skybox ray
|
|
1355
|
-
|
|
1601
|
+
// 7 × vec4f: (exposure, invGamma, _, _) · (bloom tint, intensity) ·
|
|
1602
|
+
// (bg rgb, mode) · camera right/up/forward basis for the 360 skybox ray ·
|
|
1603
|
+
// (time, _, canvas width, canvas height) for user background effects.
|
|
1604
|
+
size: 112,
|
|
1605
|
+
usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
|
|
1606
|
+
});
|
|
1607
|
+
this.bgParamsDummyBuffer = this.device.createBuffer({
|
|
1608
|
+
label: "bg effect params (dummy)",
|
|
1609
|
+
size: 16,
|
|
1356
1610
|
usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
|
|
1357
1611
|
});
|
|
1358
1612
|
this.compositeBindGroupLayout = this.device.createBindGroupLayout({
|
|
@@ -1369,6 +1623,9 @@ export class Engine {
|
|
|
1369
1623
|
{ binding: 5, visibility: GPUShaderStage.FRAGMENT, texture: {} },
|
|
1370
1624
|
// 360 backdrop equirect (PhotoDome-style skybox) — 1×1 fallback when unset.
|
|
1371
1625
|
{ binding: 6, visibility: GPUShaderStage.FRAGMENT, texture: {} },
|
|
1626
|
+
// User background-effect params — dummy buffer when no effect is set. The
|
|
1627
|
+
// layout is explicit, so the base shader legally ignores the binding.
|
|
1628
|
+
{ binding: 7, visibility: GPUShaderStage.FRAGMENT, buffer: { type: "uniform" } },
|
|
1372
1629
|
],
|
|
1373
1630
|
});
|
|
1374
1631
|
this.fallbackEquirectTexture = this.device.createTexture({
|
|
@@ -1378,27 +1635,15 @@ export class Engine {
|
|
|
1378
1635
|
usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST,
|
|
1379
1636
|
});
|
|
1380
1637
|
this.fallbackEquirectView = this.fallbackEquirectTexture.createView();
|
|
1381
|
-
|
|
1382
|
-
label: "composite shader",
|
|
1383
|
-
code: COMPOSITE_SHADER_WGSL,
|
|
1384
|
-
});
|
|
1385
|
-
const compositePipelineLayout = this.device.createPipelineLayout({
|
|
1638
|
+
this.compositePipelineLayout = this.device.createPipelineLayout({
|
|
1386
1639
|
bindGroupLayouts: [this.compositeBindGroupLayout],
|
|
1387
1640
|
});
|
|
1388
|
-
const
|
|
1389
|
-
label,
|
|
1390
|
-
|
|
1391
|
-
vertex: { module: compositeShader, entryPoint: "vs" },
|
|
1392
|
-
fragment: {
|
|
1393
|
-
module: compositeShader,
|
|
1394
|
-
entryPoint: "fs",
|
|
1395
|
-
constants: { APPLY_GAMMA: applyGamma ? 1 : 0 },
|
|
1396
|
-
targets: [{ format: this.presentationFormat }],
|
|
1397
|
-
},
|
|
1398
|
-
primitive: { topology: "triangle-list" },
|
|
1641
|
+
const compositeShader = this.device.createShaderModule({
|
|
1642
|
+
label: "composite shader",
|
|
1643
|
+
code: buildCompositeShader(null),
|
|
1399
1644
|
});
|
|
1400
|
-
this.compositePipelineIdentity = makeCompositePipeline(false, "composite pipeline (gamma=1)");
|
|
1401
|
-
this.compositePipelineGamma = makeCompositePipeline(true, "composite pipeline (gamma!=1)");
|
|
1645
|
+
this.compositePipelineIdentity = this.makeCompositePipeline(compositeShader, false, "composite pipeline (gamma=1)");
|
|
1646
|
+
this.compositePipelineGamma = this.makeCompositePipeline(compositeShader, true, "composite pipeline (gamma!=1)");
|
|
1402
1647
|
// GPU vertex-morph compute pipeline (shared by all models; per-model bind groups).
|
|
1403
1648
|
// Bindings: 0-4 read-only storage (base pos, CSR rowStart/colMorph/colOffset, weights),
|
|
1404
1649
|
// 5 read-write storage (vertex buffer), 6 uniform (params).
|
|
@@ -2193,9 +2438,22 @@ export class Engine {
|
|
|
2193
2438
|
inst.model.stopAnimation();
|
|
2194
2439
|
for (const path of inst.textureCacheKeys) {
|
|
2195
2440
|
const tex = this.textureCache.get(path);
|
|
2196
|
-
if (tex)
|
|
2441
|
+
if (!tex)
|
|
2442
|
+
continue;
|
|
2443
|
+
// The texture cache is shared across models — destroy only when no OTHER
|
|
2444
|
+
// live instance references the key, else the survivor submits with a
|
|
2445
|
+
// destroyed texture.
|
|
2446
|
+
let shared = false;
|
|
2447
|
+
for (const other of this.modelInstances.values()) {
|
|
2448
|
+
if (other !== inst && other.textureCacheKeys.includes(path)) {
|
|
2449
|
+
shared = true;
|
|
2450
|
+
break;
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
if (!shared) {
|
|
2197
2454
|
tex.destroy();
|
|
2198
2455
|
this.textureCache.delete(path);
|
|
2456
|
+
this.textureAlphaCache.delete(path);
|
|
2199
2457
|
}
|
|
2200
2458
|
}
|
|
2201
2459
|
for (const buf of inst.gpuBuffers) {
|
|
@@ -2686,12 +2944,17 @@ export class Engine {
|
|
|
2686
2944
|
const prefix = `${inst.name}: `;
|
|
2687
2945
|
// 1-based so that (0,0) = clear color = "no hit"
|
|
2688
2946
|
const modelId = this.modelInstances.size + 1;
|
|
2947
|
+
const texLogicalPath = (texIndex) => texIndex < 0 || texIndex >= textures.length
|
|
2948
|
+
? null
|
|
2949
|
+
: joinAssetPath(inst.basePath, normalizeAssetPath(textures[texIndex].path));
|
|
2689
2950
|
const loadTextureByIndex = async (texIndex) => {
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
const logicalPath = joinAssetPath(inst.basePath, normalizeAssetPath(textures[texIndex].path));
|
|
2693
|
-
return this.createTextureFromLogicalPath(inst, logicalPath);
|
|
2951
|
+
const logicalPath = texLogicalPath(texIndex);
|
|
2952
|
+
return logicalPath ? this.createTextureFromLogicalPath(inst, logicalPath) : null;
|
|
2694
2953
|
};
|
|
2954
|
+
// Mesh data for sheerness sampling (8 floats/vertex; uv at +6). See
|
|
2955
|
+
// materialIsSheer — classification happens per material below.
|
|
2956
|
+
const meshVertices = model.getVertices();
|
|
2957
|
+
const meshIndices = model.getIndices();
|
|
2695
2958
|
// 頭 bone index for the eye shader's rear-view gate (-1 when absent).
|
|
2696
2959
|
const headBoneIndex = model.getSkeleton().bones.findIndex((b) => b.name === "頭");
|
|
2697
2960
|
let currentIndexOffset = 0;
|
|
@@ -2707,7 +2970,17 @@ export class Engine {
|
|
|
2707
2970
|
diffuseTexture = this.fallbackMaterialTexture;
|
|
2708
2971
|
}
|
|
2709
2972
|
const materialAlpha = mat.diffuse[3];
|
|
2710
|
-
|
|
2973
|
+
// Transparent bucket when the MATERIAL says so — or when the TEXTURE does
|
|
2974
|
+
// (sheer cloth almost always ships with diffuse alpha 1.0 and carries its
|
|
2975
|
+
// translucency in texture alpha). Transparent-bucket draws happen after
|
|
2976
|
+
// the opaque bucket (and after the late-drawn hair render-class), so a
|
|
2977
|
+
// veil composites over the hair behind it instead of depth-rejecting it;
|
|
2978
|
+
// they are also excluded from the shadow map, so sheer cloth stops
|
|
2979
|
+
// casting the solid shadow of an opaque sheet.
|
|
2980
|
+
const diffusePath = texLogicalPath(mat.diffuseTextureIndex);
|
|
2981
|
+
const alphaSampler = diffusePath ? this.textureAlphaCache.get(diffusePath) : null;
|
|
2982
|
+
const isTransparent = materialAlpha < 1.0 - 0.001 ||
|
|
2983
|
+
materialIsSheer(meshVertices, meshIndices, currentIndexOffset, indexCount, alphaSampler);
|
|
2711
2984
|
// Sphere map (sph=1 multiply / spa=2 add). Mode 3 (sub-texture UV) is
|
|
2712
2985
|
// rare and not implemented — treated as none, like a failed load.
|
|
2713
2986
|
let sphereMode = mat.sphereMode === 1 || mat.sphereMode === 2 ? mat.sphereMode : 0;
|
|
@@ -2833,6 +3106,13 @@ export class Engine {
|
|
|
2833
3106
|
const cacheKey = logicalPath;
|
|
2834
3107
|
const cached = this.textureCache.get(cacheKey);
|
|
2835
3108
|
if (cached) {
|
|
3109
|
+
// Record the reference on THIS instance too — the cache is engine-global
|
|
3110
|
+
// (two PMX in one folder share texture paths), and removeModel decides
|
|
3111
|
+
// destruction by who still references a key. Without this, a cache-hit
|
|
3112
|
+
// borrower kept rendering a texture the creator's removal destroyed
|
|
3113
|
+
// ("Destroyed texture used in a submit").
|
|
3114
|
+
if (!inst.textureCacheKeys.includes(cacheKey))
|
|
3115
|
+
inst.textureCacheKeys.push(cacheKey);
|
|
2836
3116
|
return cached;
|
|
2837
3117
|
}
|
|
2838
3118
|
let buffer;
|
|
@@ -2876,6 +3156,9 @@ export class Engine {
|
|
|
2876
3156
|
return null;
|
|
2877
3157
|
}
|
|
2878
3158
|
}
|
|
3159
|
+
// CPU alpha sampler for sheerness classification (see textureAlphaCache).
|
|
3160
|
+
// Canvas 2D premultiplies RGB on readback, but the ALPHA channel is exact.
|
|
3161
|
+
this.textureAlphaCache.set(cacheKey, buildAlphaSampler(source, rgba, width, height));
|
|
2879
3162
|
const mipLevelCount = Math.floor(Math.log2(Math.max(width, height))) + 1;
|
|
2880
3163
|
const texture = this.device.createTexture({
|
|
2881
3164
|
label: `texture: ${cacheKey}`,
|
|
@@ -3894,7 +4177,7 @@ export class Engine {
|
|
|
3894
4177
|
// is LEFT-HANDED (+Z forward, see Mat4.lookAtInto), so the world-space
|
|
3895
4178
|
// right/up/FORWARD vectors are rows 0/1/2 of its rotation block directly
|
|
3896
4179
|
// (column-major storage: row i = values[i], values[i+4], values[i+8]).
|
|
3897
|
-
if (this.backdropEquirectView && this.compositeUniformBuffer) {
|
|
4180
|
+
if ((this.backdropEquirectView || this.backgroundEffect) && this.compositeUniformBuffer) {
|
|
3898
4181
|
const v = viewMatrix.values;
|
|
3899
4182
|
const u = this.compositeUniformData;
|
|
3900
4183
|
const tanHalf = Math.tan((this.camera.fov ?? Math.PI / 4) / 2);
|
|
@@ -3911,6 +4194,10 @@ export class Engine {
|
|
|
3911
4194
|
u[21] = v[6];
|
|
3912
4195
|
u[22] = v[10];
|
|
3913
4196
|
u[23] = 0;
|
|
4197
|
+
// Effect clock + canvas size (viewU[6]) — written on the same refresh.
|
|
4198
|
+
u[24] = (performance.now() - this.bgEffectEpochMs) / 1000;
|
|
4199
|
+
u[26] = this.canvas.width;
|
|
4200
|
+
u[27] = this.canvas.height;
|
|
3914
4201
|
this.device.queue.writeBuffer(this.compositeUniformBuffer, 0, u);
|
|
3915
4202
|
}
|
|
3916
4203
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare class GpuTimestamp {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
readonly supported: boolean;
|
|
4
|
+
private device;
|
|
5
|
+
private querySet;
|
|
6
|
+
private resolveBuffer;
|
|
7
|
+
private readbackBuffer;
|
|
8
|
+
private nextSlot;
|
|
9
|
+
private frameLabels;
|
|
10
|
+
private inFlight;
|
|
11
|
+
private pendingLabels;
|
|
12
|
+
constructor(device: GPUDevice);
|
|
13
|
+
private ensureCreated;
|
|
14
|
+
beginFrame(): void;
|
|
15
|
+
wrap(desc: GPURenderPassDescriptor, label: string): GPURenderPassDescriptor;
|
|
16
|
+
endFrame(encoder: GPUCommandEncoder): void;
|
|
17
|
+
afterSubmit(): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=gpu-profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpu-profile.d.ts","sourceRoot":"","sources":["../src/gpu-profile.ts"],"names":[],"mappings":"AAoBA,qBAAa,YAAY;IACvB,OAAO,UAAQ;IACf,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,QAAQ,CAA2B;IAC3C,OAAO,CAAC,aAAa,CAAyB;IAC9C,OAAO,CAAC,cAAc,CAAyB;IAC/C,OAAO,CAAC,QAAQ,CAAI;IACpB,OAAO,CAAC,WAAW,CAAe;IAClC,OAAO,CAAC,QAAQ,CAAQ;IAKxB,OAAO,CAAC,aAAa,CAAwB;gBAEjC,MAAM,EAAE,SAAS;IAK7B,OAAO,CAAC,aAAa;IAiBrB,UAAU,IAAI,IAAI;IAWlB,IAAI,CAAC,IAAI,EAAE,uBAAuB,EAAE,KAAK,EAAE,MAAM,GAAG,uBAAuB;IAqB3E,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI;IAW1C,WAAW,IAAI,IAAI;CAwBpB"}
|