narrator-avatar 1.1.1 → 1.1.4

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 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 ultra on mobile. `'ultra'` \| `'balanced'` \| `'performance'` |
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
- `visualQuality="auto"` (default) keeps **ultra-realistic** polish on desktop and a **balanced ultra** tier on mobile (same lighting and skin shaders, tuned GPU settings).
143
+ Use **one** model URL per avatar (e.g. `/avatars/tutor.glb`). The component adapts at runtime no `-mobile` / `-web` copies.
143
144
 
144
- Ship optimized GLBs beside each source model:
145
+ | Mechanism | Desktop | Mobile / slow network |
146
+ |-----------|---------|------------------------|
147
+ | `visualQuality="auto"` | `ultra` — 60 FPS, 4K shadows, full skin polish | `balanced` — 30 FPS, 1K shadows, same look, lighter GPU |
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
- | File | Use |
147
- |------|-----|
148
- | `avatar-web.glb` | Desktop / tablet (1024px textures, ~3–5MB) |
149
- | `avatar-mobile.glb` | Phones (512px textures, ~1–2MB) |
152
+ ```jsx
153
+ <NarratorAvatar
154
+ avatarUrl="/avatars/test.glb"
155
+ visualQuality="auto"
156
+ lazyMount="auto"
157
+ />
158
+ ```
150
159
 
151
- `avatarUrl="/avatars/avatar.glb"` resolves automatically to `-web` or `-mobile`.
160
+ **App tips:** mount only one avatar on narrow viewports; enable gzip/brotli for static `.glb` on your CDN/hosting.
152
161
 
153
- ```bash
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
- Keep `modelPixelRatio` near **1–1.25**. TalkingHead multiplies it again by `devicePixelRatio`; the old value of `4` meant up to 12× pixels on retina phones.
164
+ **Next.js:** dedupe React in `next.config` (see `narrator-avatar-test/next.config.ts`).
158
165
 
159
166
  ## License
160
167