narrator-avatar 1.1.1 → 1.1.5
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 +20 -13
- package/dist/narrator-avatar.js +4320 -4259
- package/dist/narrator-avatar.umd.cjs +147 -147
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,7 +91,8 @@ function MyPage() {
|
|
|
91
91
|
| `lipsyncModules` | Array of language codes (default `['en']`) |
|
|
92
92
|
| `lipsyncLang` | Lip-sync language (default `'en'`) |
|
|
93
93
|
| `visualPreset` | Lighting preset: `'cinematic'`, `'beauty'`, `'studio'`, `'sunset'`, `'broadcast'` |
|
|
94
|
-
| `visualQuality` | `'auto'` (default): ultra on desktop, balanced
|
|
94
|
+
| `visualQuality` | `'auto'` (default): ultra on desktop, balanced on mobile/slow network. `'ultra'` \| `'balanced'` \| `'performance'` |
|
|
95
|
+
| `lazyMount` | `true` \| `false` \| `'auto'` (default): defer WebGL init until visible on mobile |
|
|
95
96
|
| `skinGloss` | Skin sheen/sweat intensity from `0` to `2` |
|
|
96
97
|
| `skinPores` | Procedural pore/normal intensity from `0` to `2` |
|
|
97
98
|
| `skinWarmth` | Warm skin tone blend from `0` to `2` |
|
|
@@ -137,24 +138,30 @@ function MyPage() {
|
|
|
137
138
|
|
|
138
139
|
The package is JavaScript. For TypeScript, add a declaration file (e.g. `src/narrator-avatar.d.ts`) that declares the component props and ref type, or use the component with `// @ts-expect-error` if you prefer.
|
|
139
140
|
|
|
140
|
-
## Performance (web and mobile)
|
|
141
|
+
## Performance (web and mobile, one GLB per avatar)
|
|
141
142
|
|
|
142
|
-
|
|
143
|
+
Use **one** model URL per avatar (e.g. `/avatars/tutor.glb`). The component adapts at runtime — no `-mobile` / `-web` copies.
|
|
143
144
|
|
|
144
|
-
|
|
145
|
+
| Mechanism | Desktop | Mobile / slow network |
|
|
146
|
+
|-----------|---------|------------------------|
|
|
147
|
+
| `visualQuality="auto"` | `ultra` — 60 FPS, 4K shadows, full skin polish | `balanced` — 24 FPS, capped resolution, no shadows, lightweight skin (TalkingHead lights only) |
|
|
148
|
+
| `lazyMount="auto"` | init immediately | init when scrolled into view |
|
|
149
|
+
| Load timeout | 30s | 90s (large GLB download) |
|
|
150
|
+
| Tab hidden | animation paused | animation paused |
|
|
145
151
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
152
|
+
```jsx
|
|
153
|
+
<NarratorAvatar
|
|
154
|
+
avatarUrl="/avatars/test.glb"
|
|
155
|
+
visualQuality="auto"
|
|
156
|
+
lazyMount="auto"
|
|
157
|
+
/>
|
|
158
|
+
```
|
|
150
159
|
|
|
151
|
-
|
|
160
|
+
**App tips:** mount only one avatar on narrow viewports; enable gzip/brotli for static `.glb` on your CDN/hosting.
|
|
152
161
|
|
|
153
|
-
|
|
154
|
-
npm run optimize-avatars # in narrator-avatar-test
|
|
155
|
-
```
|
|
162
|
+
Keep `modelPixelRatio` near **1–1.25**. TalkingHead multiplies it again by `devicePixelRatio`.
|
|
156
163
|
|
|
157
|
-
|
|
164
|
+
**Next.js:** dedupe React in `next.config` (see `narrator-avatar-test/next.config.ts`).
|
|
158
165
|
|
|
159
166
|
## License
|
|
160
167
|
|