sa2kit 1.6.13 → 1.6.14

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.
Files changed (57) hide show
  1. package/dist/PMXParser-L6IWHL4I.mjs +4 -0
  2. package/dist/PMXParser-L6IWHL4I.mjs.map +1 -0
  3. package/dist/PMXParser-YBS3B6HM.js +13 -0
  4. package/dist/PMXParser-YBS3B6HM.js.map +1 -0
  5. package/dist/audioDetection/index.js.map +1 -1
  6. package/dist/audioDetection/index.mjs.map +1 -1
  7. package/dist/auth/index.js +3 -3
  8. package/dist/auth/index.mjs +1 -1
  9. package/dist/{chunk-FAHLZIYQ.js → chunk-5D7ZFZIM.js} +2 -2
  10. package/dist/{chunk-FAHLZIYQ.js.map → chunk-5D7ZFZIM.js.map} +1 -1
  11. package/dist/{chunk-G4AMEDO5.js → chunk-66EHKQVS.js} +2 -2
  12. package/dist/{chunk-G4AMEDO5.js.map → chunk-66EHKQVS.js.map} +1 -1
  13. package/dist/{chunk-CDK3DHKM.mjs → chunk-GGGTJETD.mjs} +3 -3
  14. package/dist/{chunk-CDK3DHKM.mjs.map → chunk-GGGTJETD.mjs.map} +1 -1
  15. package/dist/chunk-JZXJQMVE.js +363 -0
  16. package/dist/chunk-JZXJQMVE.js.map +1 -0
  17. package/dist/{chunk-2ODO4HEI.js → chunk-LFM5QSFW.js} +2 -2
  18. package/dist/{chunk-2ODO4HEI.js.map → chunk-LFM5QSFW.js.map} +1 -1
  19. package/dist/{chunk-ZYXF3L6T.mjs → chunk-MRGFYQTC.mjs} +2 -2
  20. package/dist/{chunk-ZYXF3L6T.mjs.map → chunk-MRGFYQTC.mjs.map} +1 -1
  21. package/dist/{chunk-ZCLAF3XN.mjs → chunk-TGL6BATG.mjs} +2 -2
  22. package/dist/{chunk-ZCLAF3XN.mjs.map → chunk-TGL6BATG.mjs.map} +1 -1
  23. package/dist/{chunk-L5PW2YTI.js → chunk-UUM5BIOU.js} +7 -7
  24. package/dist/{chunk-L5PW2YTI.js.map → chunk-UUM5BIOU.js.map} +1 -1
  25. package/dist/chunk-VRTRSEEH.mjs +361 -0
  26. package/dist/chunk-VRTRSEEH.mjs.map +1 -0
  27. package/dist/{chunk-6BZ3QFA5.mjs → chunk-VZFHU553.mjs} +2 -2
  28. package/dist/{chunk-6BZ3QFA5.mjs.map → chunk-VZFHU553.mjs.map} +1 -1
  29. package/dist/imageCrop/index.js.map +1 -1
  30. package/dist/imageCrop/index.mjs.map +1 -1
  31. package/dist/index.js +1 -1
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +1 -1
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/mmd/admin/index.d.mts +1 -1
  36. package/dist/mmd/admin/index.d.ts +1 -1
  37. package/dist/mmd/index.d.mts +753 -3
  38. package/dist/mmd/index.d.ts +753 -3
  39. package/dist/mmd/index.js +7542 -5841
  40. package/dist/mmd/index.js.map +1 -1
  41. package/dist/mmd/index.mjs +7453 -5776
  42. package/dist/mmd/index.mjs.map +1 -1
  43. package/dist/mmd/server/index.d.mts +1 -1
  44. package/dist/mmd/server/index.d.ts +1 -1
  45. package/dist/music/index.js +16 -16
  46. package/dist/music/index.mjs +2 -2
  47. package/dist/music/server/index.js +8 -8
  48. package/dist/music/server/index.mjs +1 -1
  49. package/dist/testYourself/admin/index.js +3 -3
  50. package/dist/testYourself/admin/index.mjs +1 -1
  51. package/dist/testYourself/index.js +7 -7
  52. package/dist/testYourself/index.js.map +1 -1
  53. package/dist/testYourself/index.mjs +2 -2
  54. package/dist/testYourself/index.mjs.map +1 -1
  55. package/dist/{types-BB-7_WtE.d.ts → types-HorDyIRv.d.mts} +50 -0
  56. package/dist/{types-BB-7_WtE.d.mts → types-HorDyIRv.d.ts} +50 -0
  57. package/package.json +19 -17
@@ -1,8 +1,438 @@
1
- import { e as MMDPlayerBaseProps, f as MMDPlayerBaseRef, g as MMDPlayerEnhancedProps, h as MMDPlaylistProps, b as MMDPlaylistNode, d as MMDResources, i as MMDStage, j as MobileOptimization } from '../types-BB-7_WtE.js';
2
- export { M as MMDPlaylistConfig, a as MMDResourceItem, c as MMDResourceOptions, O as OutlineOptions, R as ResourceOption } from '../types-BB-7_WtE.js';
1
+ import { e as MMDPlayerBaseProps, f as MMDPlayerBaseRef, g as MMDPlayerEnhancedProps, h as MMDPlaylistProps, b as MMDPlaylistNode, d as MMDResources, i as MMDStage, j as MobileOptimization } from '../types-HorDyIRv.js';
2
+ export { M as MMDPlaylistConfig, a as MMDResourceItem, c as MMDResourceOptions, O as OutlineOptions, R as ResourceOption } from '../types-HorDyIRv.js';
3
3
  import React__default from 'react';
4
4
  import * as THREE from 'three';
5
5
 
6
+ /**
7
+ * PMX模型解析器类型定义
8
+ */
9
+ /**
10
+ * PMX文件头信息
11
+ */
12
+ interface PMXHeader {
13
+ /** 文件签名 "PMX " */
14
+ signature: string;
15
+ /** PMX版本号 */
16
+ version: number;
17
+ /** 全局设置 */
18
+ globals: {
19
+ /** 文本编码 (0=UTF16LE, 1=UTF8) */
20
+ encoding: number;
21
+ /** 追加UV数 */
22
+ additionalVec4Count: number;
23
+ /** 顶点索引大小 */
24
+ vertexIndexSize: number;
25
+ /** 纹理索引大小 */
26
+ textureIndexSize: number;
27
+ /** 材质索引大小 */
28
+ materialIndexSize: number;
29
+ /** 骨骼索引大小 */
30
+ boneIndexSize: number;
31
+ /** Morph索引大小 */
32
+ morphIndexSize: number;
33
+ /** 刚体索引大小 */
34
+ rigidBodyIndexSize: number;
35
+ };
36
+ }
37
+ /**
38
+ * PMX模型信息
39
+ */
40
+ interface PMXModelInfo {
41
+ /** 模型名称 (本地) */
42
+ modelName: string;
43
+ /** 模型名称 (英文) */
44
+ modelNameEnglish: string;
45
+ /** 注释 (本地) */
46
+ comment: string;
47
+ /** 注释 (英文) */
48
+ commentEnglish: string;
49
+ }
50
+ /**
51
+ * PMX顶点信息
52
+ */
53
+ interface PMXVertex {
54
+ /** 位置 */
55
+ position: [number, number, number];
56
+ /** 法线 */
57
+ normal: [number, number, number];
58
+ /** UV坐标 */
59
+ uv: [number, number];
60
+ /** 追加UV */
61
+ additionalVec4?: number[][];
62
+ /** 权重类型 */
63
+ weightType: number;
64
+ /** 骨骼索引 */
65
+ boneIndices: number[];
66
+ /** 骨骼权重 */
67
+ boneWeights: number[];
68
+ /** 边缘倍率 */
69
+ edgeScale: number;
70
+ }
71
+ /**
72
+ * PMX材质信息
73
+ */
74
+ interface PMXMaterial {
75
+ /** 材质名称 (本地) */
76
+ name: string;
77
+ /** 材质名称 (英文) */
78
+ nameEnglish: string;
79
+ /** 漫反射颜色 (RGBA) */
80
+ diffuse: [number, number, number, number];
81
+ /** 镜面反射颜色 (RGB) */
82
+ specular: [number, number, number];
83
+ /** 镜面反射强度 */
84
+ specularStrength: number;
85
+ /** 环境光颜色 (RGB) */
86
+ ambient: [number, number, number];
87
+ /** 绘制标志 */
88
+ drawingFlags: number;
89
+ /** 边缘颜色 (RGBA) */
90
+ edgeColor: [number, number, number, number];
91
+ /** 边缘大小 */
92
+ edgeSize: number;
93
+ /** 纹理索引 */
94
+ textureIndex: number;
95
+ /** Sphere纹理索引 */
96
+ sphereTextureIndex: number;
97
+ /** Sphere模式 (0=无, 1=乘, 2=加, 3=副纹理) */
98
+ sphereMode: number;
99
+ /** 是否使用共享Toon */
100
+ isSharedToon: boolean;
101
+ /** Toon纹理索引/共享Toon索引 */
102
+ toonTextureIndex: number;
103
+ /** 备注 */
104
+ memo: string;
105
+ /** 面数 */
106
+ surfaceCount: number;
107
+ }
108
+ /**
109
+ * PMX纹理信息
110
+ */
111
+ interface PMXTexture {
112
+ /** 纹理路径 */
113
+ path: string;
114
+ /** 纹理索引 */
115
+ index: number;
116
+ }
117
+ /**
118
+ * 材质与纹理的映射关系
119
+ */
120
+ interface MaterialTextureMapping {
121
+ /** 材质索引 */
122
+ materialIndex: number;
123
+ /** 材质名称 */
124
+ materialName: string;
125
+ /** 材质名称(英文) */
126
+ materialNameEnglish: string;
127
+ /** 主纹理 */
128
+ mainTexture?: {
129
+ index: number;
130
+ path: string;
131
+ };
132
+ /** Sphere纹理 */
133
+ sphereTexture?: {
134
+ index: number;
135
+ path: string;
136
+ mode: 'multiply' | 'add' | 'subTexture';
137
+ };
138
+ /** Toon纹理 */
139
+ toonTexture?: {
140
+ index: number;
141
+ path: string;
142
+ isShared: boolean;
143
+ };
144
+ /** 面数 */
145
+ surfaceCount: number;
146
+ }
147
+ /**
148
+ * PMX解析结果
149
+ */
150
+ interface PMXParseResult {
151
+ /** 头信息 */
152
+ header: PMXHeader;
153
+ /** 模型信息 */
154
+ modelInfo: PMXModelInfo;
155
+ /** 纹理列表 */
156
+ textures: PMXTexture[];
157
+ /** 材质列表 */
158
+ materials: PMXMaterial[];
159
+ /** 材质纹理映射 */
160
+ materialTextureMappings: MaterialTextureMapping[];
161
+ /** 顶点数量 */
162
+ vertexCount: number;
163
+ /** 面数量 */
164
+ faceCount: number;
165
+ }
166
+
167
+ /**
168
+ * PMX模型文件解析器
169
+ * 用于解析PMX格式的MMD模型文件,提取纹理映射关系
170
+ */
171
+
172
+ declare class PMXParser {
173
+ private view;
174
+ private offset;
175
+ private textEncoding;
176
+ private textureIndexSize;
177
+ private additionalVec4Count;
178
+ private vertexIndexSize;
179
+ private boneIndexSize;
180
+ /**
181
+ * 从URL加载并解析PMX文件
182
+ */
183
+ loadAndParse(url: string): Promise<PMXParseResult>;
184
+ /**
185
+ * 解析PMX文件
186
+ */
187
+ parse(buffer: ArrayBuffer): PMXParseResult;
188
+ /**
189
+ * 解析文件头
190
+ */
191
+ private parseHeader;
192
+ /**
193
+ * 解析模型信息
194
+ */
195
+ private parseModelInfo;
196
+ /**
197
+ * 跳过顶点数据(只返回数量)
198
+ */
199
+ private skipVertices;
200
+ /**
201
+ * 跳过顶点权重数据
202
+ */
203
+ private skipVertexWeight;
204
+ /**
205
+ * 跳过面数据(只返回数量)
206
+ */
207
+ private skipFaces;
208
+ /**
209
+ * 解析纹理列表
210
+ */
211
+ private parseTextures;
212
+ /**
213
+ * 解析材质列表
214
+ */
215
+ private parseMaterials;
216
+ /**
217
+ * 生成材质纹理映射
218
+ */
219
+ private generateMaterialTextureMappings;
220
+ /**
221
+ * 读取文本缓冲区
222
+ */
223
+ private readTextBuffer;
224
+ /**
225
+ * 读取固定长度字符串
226
+ */
227
+ private readString;
228
+ /**
229
+ * 读取索引
230
+ */
231
+ private readIndex;
232
+ }
233
+
234
+ /**
235
+ * PMX模型编辑器
236
+ * 支持修改材质、纹理绑定等
237
+ */
238
+
239
+ interface PMXEditOperation {
240
+ type: 'material' | 'texture' | 'binding';
241
+ action: 'add' | 'update' | 'delete';
242
+ target: number;
243
+ data?: any;
244
+ }
245
+ interface PMXEditHistory {
246
+ operation: PMXEditOperation;
247
+ timestamp: number;
248
+ description: string;
249
+ }
250
+ declare class PMXEditor$1 {
251
+ private data;
252
+ private history;
253
+ private historyIndex;
254
+ private maxHistory;
255
+ constructor(parseResult: PMXParseResult);
256
+ /**
257
+ * 获取当前数据
258
+ */
259
+ getData(): PMXParseResult;
260
+ /**
261
+ * 获取编辑历史
262
+ */
263
+ getHistory(): PMXEditHistory[];
264
+ /**
265
+ * 是否可以撤销
266
+ */
267
+ canUndo(): boolean;
268
+ /**
269
+ * 是否可以重做
270
+ */
271
+ canRedo(): boolean;
272
+ /**
273
+ * 撤销
274
+ */
275
+ undo(): boolean;
276
+ /**
277
+ * 重做
278
+ */
279
+ redo(): boolean;
280
+ /**
281
+ * 添加纹理
282
+ */
283
+ addTexture(path: string): number;
284
+ /**
285
+ * 更新纹理路径
286
+ */
287
+ updateTexture(index: number, newPath: string): boolean;
288
+ /**
289
+ * 删除纹理
290
+ */
291
+ deleteTexture(index: number): boolean;
292
+ /**
293
+ * 更新材质的主纹理绑定
294
+ */
295
+ setMaterialMainTexture(materialIndex: number, textureIndex: number): boolean;
296
+ /**
297
+ * 更新材质的Sphere纹理绑定
298
+ */
299
+ setMaterialSphereTexture(materialIndex: number, textureIndex: number, mode?: number): boolean;
300
+ /**
301
+ * 更新材质的Toon纹理绑定
302
+ */
303
+ setMaterialToonTexture(materialIndex: number, textureIndex: number, isShared?: boolean): boolean;
304
+ /**
305
+ * 更新材质属性
306
+ */
307
+ updateMaterial(materialIndex: number, updates: Partial<PMXMaterial>): boolean;
308
+ /**
309
+ * 重新生成材质纹理映射
310
+ */
311
+ private regenerateMappings;
312
+ /**
313
+ * 记录历史
314
+ */
315
+ private recordHistory;
316
+ /**
317
+ * 获取统计信息
318
+ */
319
+ getStats(): {
320
+ textures: number;
321
+ materials: number;
322
+ vertices: number;
323
+ faces: number;
324
+ unusedTextures: number;
325
+ editHistory: number;
326
+ };
327
+ /**
328
+ * 获取未使用的纹理
329
+ */
330
+ getUnusedTextures(): PMXTexture[];
331
+ }
332
+
333
+ /**
334
+ * PMX模型导出器
335
+ * 将编辑后的PMX数据导出为二进制文件
336
+ */
337
+
338
+ declare class PMXExporter {
339
+ private data;
340
+ private buffer;
341
+ private view;
342
+ private offset;
343
+ constructor(data: PMXParseResult);
344
+ /**
345
+ * 导出为ArrayBuffer
346
+ */
347
+ export(): ArrayBuffer;
348
+ /**
349
+ * 导出为Blob
350
+ */
351
+ exportAsBlob(): Blob;
352
+ /**
353
+ * 导出并下载
354
+ */
355
+ exportAndDownload(filename?: string): void;
356
+ /**
357
+ * 估算文件大小
358
+ */
359
+ private estimateSize;
360
+ /**
361
+ * 写入头部
362
+ */
363
+ private writeHeader;
364
+ /**
365
+ * 写入模型信息
366
+ */
367
+ private writeModelInfo;
368
+ /**
369
+ * 写入顶点占位符
370
+ */
371
+ private writeVertexPlaceholder;
372
+ /**
373
+ * 写入面占位符
374
+ */
375
+ private writeFacePlaceholder;
376
+ /**
377
+ * 写入纹理列表
378
+ */
379
+ private writeTextures;
380
+ /**
381
+ * 写入材质
382
+ */
383
+ private writeMaterials;
384
+ /**
385
+ * 写入文本缓冲区
386
+ */
387
+ private writeTextBuffer;
388
+ /**
389
+ * 写入固定长度字符串
390
+ */
391
+ private writeString;
392
+ /**
393
+ * 写入索引
394
+ */
395
+ private writeIndex;
396
+ }
397
+
398
+ /**
399
+ * PMX模型编辑器组件
400
+ * 提供可视化的材质纹理绑定编辑功能
401
+ */
402
+
403
+ interface PMXEditorProps {
404
+ /** PMX模型文件URL */
405
+ modelUrl: string;
406
+ /** 基础路径(用于拼接纹理URL) */
407
+ basePath?: string;
408
+ /** 自定义样式类名 */
409
+ className?: string;
410
+ /** 解析完成回调 */
411
+ onParsed?: (result: PMXParseResult) => void;
412
+ /** 错误回调 */
413
+ onError?: (error: Error) => void;
414
+ }
415
+ declare const PMXEditor: React__default.FC<PMXEditorProps>;
416
+
417
+ /**
418
+ * PMX模型信息查看器组件
419
+ * 用于可视化展示PMX模型的纹理映射关系
420
+ */
421
+
422
+ interface PMXViewerProps {
423
+ /** PMX模型文件URL */
424
+ modelUrl: string;
425
+ /** 基础路径(用于拼接纹理URL) */
426
+ basePath?: string;
427
+ /** 自定义样式类名 */
428
+ className?: string;
429
+ /** 解析完成回调 */
430
+ onParsed?: (result: PMXParseResult) => void;
431
+ /** 错误回调 */
432
+ onError?: (error: Error) => void;
433
+ }
434
+ declare const PMXViewer: React__default.FC<PMXViewerProps>;
435
+
6
436
  declare const MMDPlayerBase: React__default.ForwardRefExoticComponent<MMDPlayerBaseProps & React__default.RefAttributes<MMDPlayerBaseRef>>;
7
437
 
8
438
  declare const MMDPlayerEnhanced: React__default.FC<MMDPlayerEnhancedProps>;
@@ -48,6 +478,101 @@ interface MMDPlaylistDebugInfoProps {
48
478
  }
49
479
  declare const MMDPlaylistDebugInfo: React__default.FC<MMDPlaylistDebugInfoProps>;
50
480
 
481
+ /**
482
+ * MMD光照调试面板
483
+ * 实时调整渲染器、光源、材质参数
484
+ */
485
+
486
+ /**
487
+ * 光照参数接口
488
+ */
489
+ interface MMDLightingParams {
490
+ /** 色调映射类型 (0=None, 1=Linear, 2=Reinhard, 3=Cineon, 4=ACESFilmic) */
491
+ toneMapping: number;
492
+ /** 色调映射曝光值 */
493
+ toneMappingExposure: number;
494
+ /** 环境光强度 */
495
+ ambientIntensity: number;
496
+ /** 主方向光强度 */
497
+ directionalIntensity: number;
498
+ /** 主方向光X轴位置 */
499
+ directionalX: number;
500
+ /** 主方向光Y轴位置 */
501
+ directionalY: number;
502
+ /** 主方向光Z轴位置 */
503
+ directionalZ: number;
504
+ /** 侧面补光强度 */
505
+ sideIntensity: number;
506
+ /** 半球光强度 */
507
+ hemisphereIntensity: number;
508
+ /** 材质自发光强度 */
509
+ emissiveIntensity: number;
510
+ /** 颜色亮度系数 */
511
+ colorBrightness: number;
512
+ /** 颜色饱和度系数 */
513
+ colorSaturation: number;
514
+ /** 是否启用阴影 */
515
+ enableShadows: boolean;
516
+ /** 模型是否接收阴影 */
517
+ receiveShadow: boolean;
518
+ /** 阴影偏移 */
519
+ shadowBias: number;
520
+ /** 高光强度(Shininess) */
521
+ shininess: number;
522
+ /** 高光颜色亮度 */
523
+ specularIntensity: number;
524
+ /** 反射率 */
525
+ reflectivity: number;
526
+ /** 金属度 */
527
+ metalness: number;
528
+ /** 粗糙度 */
529
+ roughness: number;
530
+ /** 环境光遮蔽强度 */
531
+ aoMapIntensity: number;
532
+ /** 边缘光强度 */
533
+ rimLightIntensity: number;
534
+ /** 边缘光颜色 */
535
+ rimLightColor: string;
536
+ }
537
+ /**
538
+ * 场景引用接口
539
+ */
540
+ interface MMDSceneRefs {
541
+ /** 渲染器 */
542
+ renderer: THREE.WebGLRenderer | null;
543
+ /** 环境光 */
544
+ ambientLight: THREE.AmbientLight | null;
545
+ /** 主方向光 */
546
+ directionalLight: THREE.DirectionalLight | null;
547
+ /** 侧面补光 */
548
+ sideLight: THREE.DirectionalLight | null;
549
+ /** 半球光 */
550
+ hemisphereLight: THREE.HemisphereLight | null;
551
+ /** MMD模型网格 */
552
+ mmdMesh: THREE.SkinnedMesh | null;
553
+ }
554
+ /**
555
+ * 组件Props
556
+ */
557
+ interface MMDLightingDebugPanelProps {
558
+ /** 场景引用(包含渲染器、光源、模型等) */
559
+ sceneRefs: React__default.MutableRefObject<MMDSceneRefs>;
560
+ /** 初始参数(可选) */
561
+ initialParams?: Partial<MMDLightingParams>;
562
+ /** 参数变化回调(可选) */
563
+ onParamsChange?: (params: MMDLightingParams) => void;
564
+ /** 是否默认显示(默认true) */
565
+ defaultVisible?: boolean;
566
+ /** 面板位置(默认'right') */
567
+ position?: 'left' | 'right';
568
+ /** 自定义类名 */
569
+ className?: string;
570
+ }
571
+ /**
572
+ * MMD光照调试面板组件
573
+ */
574
+ declare const MMDLightingDebugPanel: React__default.FC<MMDLightingDebugPanelProps>;
575
+
51
576
  /**
52
577
  * Ammo.js 加载器
53
578
  * 用于异步加载 Ammo.js 物理引擎 (WASM 版本)
@@ -63,6 +588,227 @@ declare global {
63
588
  */
64
589
  declare const loadAmmo: (path?: string) => Promise<any>;
65
590
 
591
+ /**
592
+ * MMD加载器优化配置
593
+ * 用于获得接近MMD软件的渲染效果
594
+ */
595
+
596
+ interface MMDLoaderConfig {
597
+ /** Toon纹理路径 */
598
+ toonPath?: string;
599
+ /** 资源基础路径 */
600
+ resourcePath?: string;
601
+ /** 启用渐变贴图(用于Toon材质) */
602
+ enableGradientMap?: boolean;
603
+ /** 高光强度 */
604
+ shininess?: number;
605
+ /** 高光颜色 */
606
+ specularColor?: THREE.ColorRepresentation;
607
+ }
608
+ /**
609
+ * 配置MMD材质以获得最佳渲染效果
610
+ *
611
+ * 主要优化点:
612
+ * 1. 为MeshToonMaterial添加渐变贴图(实现阶梯式明暗过渡)
613
+ * 2. 调整高光参数(shininess, specular)
614
+ * 3. 确保纹理使用正确的颜色空间
615
+ * 4. 优化环境贴图(sphere texture)设置
616
+ *
617
+ * @param mesh - MMD模型网格
618
+ * @param config - 配置选项
619
+ */
620
+ declare function configureMaterialsForMMD(mesh: THREE.SkinnedMesh, config?: MMDLoaderConfig): void;
621
+ /**
622
+ * 创建MMD风格的光照设置
623
+ *
624
+ * MMD默认使用3点光照:
625
+ * 1. 主光源(Key Light):从左前上方照射,强度最高
626
+ * 2. 补光(Fill Light):从右侧照射,减少阴影过暗
627
+ * 3. 环境光(Ambient Light):提供基础亮度
628
+ *
629
+ * @param scene - Three.js场景
630
+ * @param options - 光照选项
631
+ * @returns 光源对象
632
+ */
633
+ declare function createMMDLights(scene: THREE.Scene, options?: {
634
+ ambientIntensity?: number;
635
+ mainIntensity?: number;
636
+ fillIntensity?: number;
637
+ enableShadow?: boolean;
638
+ }): {
639
+ ambientLight: THREE.AmbientLight;
640
+ mainLight: THREE.DirectionalLight;
641
+ fillLight: THREE.DirectionalLight;
642
+ };
643
+ /**
644
+ * 配置渲染器以获得MMD风格的渲染效果
645
+ *
646
+ * 主要配置:
647
+ * 1. 色调映射:使用线性或无色调映射(避免过度曝光)
648
+ * 2. 颜色空间:sRGB(与MMD一致)
649
+ * 3. 阴影:PCF软阴影
650
+ *
651
+ * @param renderer - Three.js渲染器
652
+ * @param options - 渲染器选项
653
+ * @returns 配置后的渲染器
654
+ */
655
+ declare function configureRendererForMMD(renderer: THREE.WebGLRenderer, options?: {
656
+ toneMapping?: THREE.ToneMapping;
657
+ toneMappingExposure?: number;
658
+ enableShadow?: boolean;
659
+ }): THREE.WebGLRenderer;
660
+ /**
661
+ * 生成Toon纹理(用于测试,如果没有原版toon01-10.bmp)
662
+ *
663
+ * @param index - Toon纹理索引 (1-10)
664
+ * @returns Canvas元素
665
+ */
666
+ declare function generateToonTexture(index: number): HTMLCanvasElement;
667
+ /**
668
+ * 批量生成所有Toon纹理(1-10)
669
+ *
670
+ * @returns Toon纹理数组
671
+ */
672
+ declare function generateAllToonTextures(): THREE.CanvasTexture[];
673
+
674
+ /**
675
+ * MMD渲染诊断工具
676
+ * 用于检测模型渲染问题
677
+ */
678
+
679
+ interface MMDDiagnosticReport {
680
+ /** 材质总数 */
681
+ totalMaterials: number;
682
+ /** 有Toon纹理的材质数 */
683
+ materialsWithToon: number;
684
+ /** 有Sphere纹理的材质数 */
685
+ materialsWithSphere: number;
686
+ /** 有主纹理的材质数 */
687
+ materialsWithMainTexture: number;
688
+ /** MeshToonMaterial数量 */
689
+ toonMaterialCount: number;
690
+ /** MeshPhongMaterial数量 */
691
+ phongMaterialCount: number;
692
+ /** MeshStandardMaterial数量 */
693
+ standardMaterialCount: number;
694
+ /** 问题列表 */
695
+ issues: string[];
696
+ /** 建议列表 */
697
+ suggestions: string[];
698
+ }
699
+ /**
700
+ * 诊断MMD场景渲染问题
701
+ *
702
+ * @param scene - Three.js场景
703
+ * @param renderer - 渲染器(可选)
704
+ * @returns 诊断报告
705
+ */
706
+ declare function diagnoseMaterialsMMD(scene: THREE.Scene, renderer?: THREE.WebGLRenderer): MMDDiagnosticReport;
707
+ /**
708
+ * 打印诊断报告到控制台
709
+ *
710
+ * @param report - 诊断报告
711
+ */
712
+ declare function printDiagnosticReport(report: MMDDiagnosticReport): void;
713
+ /**
714
+ * 快速诊断(浏览器控制台友好版本)
715
+ *
716
+ * 使用方法:
717
+ * 1. 在浏览器控制台运行
718
+ * 2. 将scene对象传入
719
+ *
720
+ * @param scene - Three.js场景
721
+ * @param renderer - 渲染器(可选)
722
+ */
723
+ declare function quickDiagnose(scene: THREE.Scene, renderer?: THREE.WebGLRenderer): void;
724
+ /**
725
+ * 检查特定材质的详细信息
726
+ *
727
+ * @param material - Three.js材质
728
+ * @returns 材质信息字符串
729
+ */
730
+ declare function inspectMaterial(material: THREE.Material): Record<string, any>;
731
+ /**
732
+ * 列出所有材质的详细信息
733
+ *
734
+ * @param scene - Three.js场景
735
+ */
736
+ declare function listAllMaterials(scene: THREE.Scene): void;
737
+
738
+ /**
739
+ * Sphere纹理辅助工具
740
+ * 用于检查、诊断和修复MMD模型的sphere纹理问题
741
+ */
742
+
743
+ /**
744
+ * Sphere纹理诊断结果
745
+ */
746
+ interface SphereTextureDiagnostic {
747
+ /** 检查的材质总数 */
748
+ totalMaterials: number;
749
+ /** 应该有sphere纹理的材质数(根据命名推测) */
750
+ expectedSphere: number;
751
+ /** 实际有sphere纹理的材质数 */
752
+ actualSphere: number;
753
+ /** 缺少sphere纹理的材质列表 */
754
+ missingSphere: Array<{
755
+ index: number;
756
+ name: string;
757
+ objectName: string;
758
+ }>;
759
+ /** 可能的sphere纹理文件列表 */
760
+ possibleSphereFiles: string[];
761
+ }
762
+ /**
763
+ * 检查模型是否缺少sphere纹理
764
+ *
765
+ * @param mesh - MMD模型网格
766
+ * @returns 诊断结果
767
+ */
768
+ declare function checkSphereTextures(mesh: THREE.SkinnedMesh): SphereTextureDiagnostic;
769
+ /**
770
+ * 打印sphere纹理诊断报告
771
+ *
772
+ * @param diagnostic - 诊断结果
773
+ */
774
+ declare function printSphereDiagnostic(diagnostic: SphereTextureDiagnostic): void;
775
+ /**
776
+ * 为材质添加默认的sphere纹理(临时方案)
777
+ *
778
+ * 注意:这只是临时方案,最好的方法是使用模型自带的sphere纹理文件
779
+ *
780
+ * @param mesh - MMD模型网格
781
+ * @param sphereTextureUrl - Sphere纹理URL(可选)
782
+ */
783
+ declare function addDefaultSphereTextures(mesh: THREE.SkinnedMesh, sphereTextureUrl?: string): void;
784
+ /**
785
+ * 使用PMXParser检查模型定义的sphere纹理
786
+ *
787
+ * @param modelUrl - 模型URL
788
+ * @returns Sphere纹理信息
789
+ */
790
+ declare function checkModelSphereDefinition(modelUrl: string): Promise<{
791
+ hasSphere: boolean;
792
+ sphereTextures: Array<{
793
+ materialName: string;
794
+ texturePath: string;
795
+ mode: string;
796
+ }>;
797
+ }>;
798
+ /**
799
+ * 打印模型的sphere纹理定义
800
+ *
801
+ * @param modelUrl - 模型URL
802
+ */
803
+ declare function printModelSphereInfo(modelUrl: string): Promise<void>;
804
+ /**
805
+ * 全面诊断sphere纹理问题
806
+ *
807
+ * @param mesh - 已加载的模型网格
808
+ * @param modelUrl - 模型URL
809
+ */
810
+ declare function fullSphereDiagnostic(mesh: THREE.SkinnedMesh, modelUrl: string): Promise<void>;
811
+
66
812
  /**
67
813
  * MMD Visual Novel (Galgame 风格) 类型定义
68
814
  */
@@ -218,6 +964,10 @@ interface MMDVisualNovelProps {
218
964
  onError?: (error: Error) => void;
219
965
  /** 是否显示调试信息 */
220
966
  showDebugInfo?: boolean;
967
+ /** 是否显示光照调试面板(默认false) */
968
+ showLightingDebugPanel?: boolean;
969
+ /** 光照调试面板初始参数 */
970
+ lightingDebugInitialParams?: any;
221
971
  /** 是否显示快进按钮 */
222
972
  showSkipButton?: boolean;
223
973
  /** 是否显示自动播放按钮 */
@@ -1458,4 +2208,4 @@ interface FXThreePreviewProps {
1458
2208
  }
1459
2209
  declare const FXThreePreview: React__default.FC<FXThreePreviewProps>;
1460
2210
 
1461
- export { type BranchCondition, CheerButton, type CheerButtonProps, CheerParticles, type CheerParticlesProps, type CheerParticlesRef, ChoiceMenu, type ChoiceMenuProps, DialogueBox, type DialogueBoxProps, type DialogueBoxTheme, type DialogueChoice, type DialogueHistoryItem, type DialogueLine, type EffectFileType, type FXComment, type FXController, type FXDefine, type FXEffect, type FXFileConfig, type FXMergeStrategy, type FXParameter, FXParser, type FXParserOptions, type FXPass, type FXShaderFunction, type FXStaticVariable, type FXSummary, type FXTechnique, type FXTexture, FXThreePreview, type FXThreePreviewProps, FXToThreeAdapter, FXViewer, type FXViewerProps, type GLSLShader, type GLSLShaders, HLSLToGLSLConverter, HistoryPanel, LoadingOverlay, type LoadingOverlayProps, LoadingScreen, type LoadingScreenProps, LoopConfirmDialog, MMDARPlayer, type MMDARPlayerProps, type MMDARPlayerRef, MMDMusicPlayer, type MMDMusicPlayerConfig, type MMDMusicPlayerProps, type MMDMusicPlayerRef, MMDPlayerBase, MMDPlayerBaseProps, MMDPlayerBaseRef, MMDPlayerEnhanced, MMDPlayerEnhancedDebugInfo, MMDPlayerEnhancedProps, MMDPlaylist, MMDPlaylistDebugInfo, MMDPlaylistNode, MMDPlaylistProps, MMDResources, MMDStage, MMDVisualNovel, type MMDVisualNovelProps, type MMDVisualNovelRef, MobileOptimization, MultiFXAdapter, type MultiFXAdapterOptions, MusicControls, type MusicControlsProps, type MusicTrack, PlaylistPanel, type PlaylistPanelProps, StartScreen, type StartScreenProps, type ThreeMaterialConfig, type ThreeRenderConfig, TrackInfo, type TrackInfoProps, type VisualEffect, type VisualNovelNode, type VisualNovelScript, compareFXEffects, exportFXToJSON, exportFXToMarkdown, extractTexturePaths, filterDefinesByPrefix, getColorParameters, getConfigSummaryText, getFeatureFlags, getTextureDefines, hasFeature, loadAmmo, validateFXEffect };
2211
+ export { type BranchCondition, CheerButton, type CheerButtonProps, CheerParticles, type CheerParticlesProps, type CheerParticlesRef, ChoiceMenu, type ChoiceMenuProps, DialogueBox, type DialogueBoxProps, type DialogueBoxTheme, type DialogueChoice, type DialogueHistoryItem, type DialogueLine, type EffectFileType, type FXComment, type FXController, type FXDefine, type FXEffect, type FXFileConfig, type FXMergeStrategy, type FXParameter, FXParser, type FXParserOptions, type FXPass, type FXShaderFunction, type FXStaticVariable, type FXSummary, type FXTechnique, type FXTexture, FXThreePreview, type FXThreePreviewProps, FXToThreeAdapter, FXViewer, type FXViewerProps, type GLSLShader, type GLSLShaders, HLSLToGLSLConverter, HistoryPanel, LoadingOverlay, type LoadingOverlayProps, LoadingScreen, type LoadingScreenProps, LoopConfirmDialog, MMDARPlayer, type MMDARPlayerProps, type MMDARPlayerRef, type MMDDiagnosticReport, MMDLightingDebugPanel, type MMDLightingDebugPanelProps, type MMDLightingParams, type MMDLoaderConfig, MMDMusicPlayer, type MMDMusicPlayerConfig, type MMDMusicPlayerProps, type MMDMusicPlayerRef, MMDPlayerBase, MMDPlayerBaseProps, MMDPlayerBaseRef, MMDPlayerEnhanced, MMDPlayerEnhancedDebugInfo, MMDPlayerEnhancedProps, MMDPlaylist, MMDPlaylistDebugInfo, MMDPlaylistNode, MMDPlaylistProps, MMDResources, type MMDSceneRefs, MMDStage, MMDVisualNovel, type MMDVisualNovelProps, type MMDVisualNovelRef, type MaterialTextureMapping, MobileOptimization, MultiFXAdapter, type MultiFXAdapterOptions, MusicControls, type MusicControlsProps, type MusicTrack, PMXEditor, PMXEditor$1 as PMXEditorCore, type PMXEditorProps, PMXExporter, type PMXHeader, type PMXMaterial, type PMXModelInfo, type PMXParseResult, PMXParser, type PMXTexture, type PMXVertex, PMXViewer, type PMXViewerProps, PlaylistPanel, type PlaylistPanelProps, type SphereTextureDiagnostic, StartScreen, type StartScreenProps, type ThreeMaterialConfig, type ThreeRenderConfig, TrackInfo, type TrackInfoProps, type VisualEffect, type VisualNovelNode, type VisualNovelScript, addDefaultSphereTextures, checkModelSphereDefinition, checkSphereTextures, compareFXEffects, configureMaterialsForMMD, configureRendererForMMD, createMMDLights, diagnoseMaterialsMMD, exportFXToJSON, exportFXToMarkdown, extractTexturePaths, filterDefinesByPrefix, fullSphereDiagnostic, generateAllToonTextures, generateToonTexture, getColorParameters, getConfigSummaryText, getFeatureFlags, getTextureDefines, hasFeature, inspectMaterial, listAllMaterials, loadAmmo, printDiagnosticReport, printModelSphereInfo, printSphereDiagnostic, quickDiagnose, validateFXEffect };