@doki-land/live2d 0.0.15 โ 0.0.16
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 +27 -18
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
The public runtime facade for browser-native Live2D rendering.
|
|
4
4
|
|
|
5
|
-
Use this package in browser games, game-engine integrations, interactive content, model tools, and custom webpage
|
|
5
|
+
Use this package in browser games, game-engine integrations, interactive content, model tools, and custom webpage
|
|
6
|
+
experiences. It composes the default loader, MOC runtimes, and rendering backends behind one small API.
|
|
6
7
|
|
|
7
8
|
## โจ Features
|
|
8
9
|
|
|
@@ -63,7 +64,8 @@ engine.onUpdate((deltaTime) => {
|
|
|
63
64
|
});
|
|
64
65
|
```
|
|
65
66
|
|
|
66
|
-
The delta is expressed in seconds. Keep the value bounded after tab suspension or long pauses to avoid unstable
|
|
67
|
+
The delta is expressed in seconds. Keep the value bounded after tab suspension or long pauses to avoid unstable
|
|
68
|
+
animation and physics once those systems are enabled.
|
|
67
69
|
|
|
68
70
|
## ๐ฅ Loading Models
|
|
69
71
|
|
|
@@ -82,8 +84,8 @@ await runtime.loadModel(
|
|
|
82
84
|
Listen for progress when presenting a loading interface:
|
|
83
85
|
|
|
84
86
|
```ts
|
|
85
|
-
runtime.events.on("progress", ({
|
|
86
|
-
|
|
87
|
+
runtime.events.on("progress", ({stage, progress, detail}) => {
|
|
88
|
+
console.log(stage, Math.round(progress * 100), detail);
|
|
87
89
|
});
|
|
88
90
|
```
|
|
89
91
|
|
|
@@ -115,23 +117,25 @@ if (area) {
|
|
|
115
117
|
}
|
|
116
118
|
```
|
|
117
119
|
|
|
118
|
-
Current fallback hit testing can identify visible drawables. Semantic names such as `Head` or `Body` require
|
|
120
|
+
Current fallback hit testing can identify visible drawables. Semantic names such as `Head` or `Body` require
|
|
121
|
+
corresponding model metadata and runtime support.
|
|
119
122
|
|
|
120
123
|
## ๐ Frame Profiling
|
|
121
124
|
|
|
122
125
|
```ts
|
|
123
126
|
runtime.events.on("profile", (profile) => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
console.log({
|
|
128
|
+
fps: profile.fpsSmooth,
|
|
129
|
+
frameMs: profile.frameMs,
|
|
130
|
+
evaluateMs: profile.evaluateMs,
|
|
131
|
+
drawMs: profile.drawMs,
|
|
132
|
+
drawables: profile.drawableCount,
|
|
133
|
+
});
|
|
131
134
|
});
|
|
132
135
|
```
|
|
133
136
|
|
|
134
|
-
These timings are runtime-side measurements. Use browser GPU profiling when diagnosing shader, mask, upload, or device
|
|
137
|
+
These timings are runtime-side measurements. Use browser GPU profiling when diagnosing shader, mask, upload, or device
|
|
138
|
+
scheduling costs.
|
|
135
139
|
|
|
136
140
|
## ๐งฉ Custom Pipeline
|
|
137
141
|
|
|
@@ -144,7 +148,8 @@ const runtime = createLive2D({
|
|
|
144
148
|
});
|
|
145
149
|
```
|
|
146
150
|
|
|
147
|
-
Custom implementations must preserve the contracts exported by the renderer package. Avoid moving format or renderer
|
|
151
|
+
Custom implementations must preserve the contracts exported by the renderer package. Avoid moving format or renderer
|
|
152
|
+
logic into application adapters.
|
|
148
153
|
|
|
149
154
|
## ๐งน Lifecycle
|
|
150
155
|
|
|
@@ -152,7 +157,8 @@ Custom implementations must preserve the contracts exported by the renderer pack
|
|
|
152
157
|
runtime.destroy();
|
|
153
158
|
```
|
|
154
159
|
|
|
155
|
-
Destroy the runtime when its canvas or host scene is permanently removed. This releases model state, textures, draw
|
|
160
|
+
Destroy the runtime when its canvas or host scene is permanently removed. This releases model state, textures, draw
|
|
161
|
+
passes, event listeners owned by the runtime, and graphics resources owned by the selected renderer.
|
|
156
162
|
|
|
157
163
|
## โก Performance Notes
|
|
158
164
|
|
|
@@ -160,7 +166,8 @@ Destroy the runtime when its canvas or host scene is permanently removed. This r
|
|
|
160
166
|
- Keep canvas backing dimensions intentional; CSS size alone does not limit GPU pixel work.
|
|
161
167
|
- Prefer an engine-owned loop when integrating with a game.
|
|
162
168
|
- Avoid repeatedly enumerating parameters in a hot loop.
|
|
163
|
-
- Measure the complete frame path before attributing a bottleneck to TypeScript, WebAssembly, or a specific graphics
|
|
169
|
+
- Measure the complete frame path before attributing a bottleneck to TypeScript, WebAssembly, or a specific graphics
|
|
170
|
+
API.
|
|
164
171
|
|
|
165
172
|
## ๐งช Development
|
|
166
173
|
|
|
@@ -171,11 +178,13 @@ pnpm typecheck
|
|
|
171
178
|
pnpm --filter @doki-land/live2d build
|
|
172
179
|
```
|
|
173
180
|
|
|
174
|
-
Changes to the facade should include tests for state transitions, cancellation, events, and resource cleanup where
|
|
181
|
+
Changes to the facade should include tests for state transitions, cancellation, events, and resource cleanup where
|
|
182
|
+
applicable.
|
|
175
183
|
|
|
176
184
|
## ๐ค Contributing
|
|
177
185
|
|
|
178
|
-
Keep the facade small. Model-format behavior belongs in `@doki-land/live2d-renderer`, source resolution belongs in
|
|
186
|
+
Keep the facade small. Model-format behavior belongs in `@doki-land/live2d-renderer`, source resolution belongs in
|
|
187
|
+
`@doki-land/live2d-loader`, and webpage chrome belongs in `@doki-land/live2d-widget`.
|
|
179
188
|
|
|
180
189
|
## ๐ License
|
|
181
190
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doki-land/live2d",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "Live2D in the browser โ load moc2/moc3 models, Stage + multi-actor, motion; WebGPU/WebGL2/Canvas2D. Main entry for live2d.ts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"test": "vitest run --passWithNoTests"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@doki-land/live2d-core": "0.0.
|
|
63
|
-
"@doki-land/live2d-loader": "0.0.
|
|
64
|
-
"@doki-land/live2d-renderer": "0.0.
|
|
62
|
+
"@doki-land/live2d-core": "0.0.16",
|
|
63
|
+
"@doki-land/live2d-loader": "0.0.16",
|
|
64
|
+
"@doki-land/live2d-renderer": "0.0.16"
|
|
65
65
|
},
|
|
66
66
|
"sideEffects": false
|
|
67
67
|
}
|