daydreamer-json commited on
Commit
9ad2fa5
·
verified ·
1 Parent(s): 6c7140d
res/model/{Lumine.bpmx → HuTao/HuTao.pmx} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:05ff01ac153eab51821615badde67e5040ac6b799fb8285e38a3331453bfb01f
3
- size 9000317
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e98189f1f36d1052a424d4ceb61eab28ef59e49fd8717db4ba2ad96081ce8a17
3
+ size 1273366
res/model/HuTao/hair.bmp ADDED

Git LFS Details

  • SHA256: c7b84dc9c8428c0861c69c75e8928540949c419a297d204fa8a22c9c12b5d295
  • Pointer size: 128 Bytes
  • Size of remote file: 822 Bytes
res/model/HuTao/skin.bmp ADDED

Git LFS Details

  • SHA256: 98f80a63fcd799f29ea3aa8abd14bd8d4c4a42c8e90d9b6cf340dd3f1e867992
  • Pointer size: 129 Bytes
  • Size of remote file: 3.13 kB
res/model/HuTao/skin_old.bmp ADDED

Git LFS Details

  • SHA256: 309be2393fc604afc2494693feb61960a429491f867d7e94477df82d1c5127cc
  • Pointer size: 129 Bytes
  • Size of remote file: 3.13 kB
res/model/HuTao/tex/发.png ADDED

Git LFS Details

  • SHA256: 71adc4deabb72e935d02cfddb1f1f5f256da55b0af3a853d1b61ba32bcdf02da
  • Pointer size: 132 Bytes
  • Size of remote file: 2.03 MB
res/model/HuTao/tex/服.png ADDED

Git LFS Details

  • SHA256: ce415c0234f25a489233f6cc0c9ed2009985f5a36f8ad12384f3a6ac0b00de14
  • Pointer size: 132 Bytes
  • Size of remote file: 1.45 MB
res/model/HuTao/tex/面.png ADDED

Git LFS Details

  • SHA256: b7ba7f2b1f78698934b60c54ef1e3232942d4cb9aa82456175e24e467d6aedc1
  • Pointer size: 131 Bytes
  • Size of remote file: 976 kB
res/model/HuTao/toon_defo.bmp ADDED

Git LFS Details

  • SHA256: c60557dfb11a642f12a70bc7c3628918489470606bd0f7ef142c93495b4b3bd6
  • Pointer size: 128 Bytes
  • Size of remote file: 822 Bytes
res/model/Lumine/Lumine.pmx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7775e1cc6a9cd6d7840f6567aedf91704ced1fb516c5835307ec4da81a309e3d
3
+ size 2328588
res/model/Lumine/LumineModified.pmx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f26626d0d809f9d148c904f20bf67bf54409fa07cf2a0e308370edf75a94677
3
+ size 2328634
res/model/Lumine/Texture/mc3.png ADDED

Git LFS Details

  • SHA256: 988d8189318072892936e5cf90582c6edfa8dea026c611ec2dcdde84279c1535
  • Pointer size: 130 Bytes
  • Size of remote file: 33.9 kB
res/model/Lumine/Texture/toon.png ADDED

Git LFS Details

  • SHA256: d72fc89f774e6b2c0b5352d6cb9a6d59fcab3e8780ccaac529c063c3f29f7396
  • Pointer size: 129 Bytes
  • Size of remote file: 1.27 kB
res/model/Lumine/Texture/toon02.bmp ADDED

Git LFS Details

  • SHA256: af1246cd9cf57d833f0eccc1fadbe7c7f88baddf3173bc103d373c2e3e82aed1
  • Pointer size: 129 Bytes
  • Size of remote file: 3.13 kB
res/model/Lumine/Texture/toon02_75.png ADDED

Git LFS Details

  • SHA256: ee86fa20709bb9acd7582025f9df519d327e39cb9f04d61bd5c05089cfb0a0fa
  • Pointer size: 128 Bytes
  • Size of remote file: 237 Bytes
res/model/Lumine/Texture/头发.png ADDED

Git LFS Details

  • SHA256: dd5c255c2147120e44a09bb81d0e05ba6f4da32296262af30d527ac599faeb54
  • Pointer size: 132 Bytes
  • Size of remote file: 1.79 MB
res/model/Lumine/Texture/脸.png ADDED

Git LFS Details

  • SHA256: 912cc2b246c859721a54d9f4397c12edc8f975f7e5372ddb8ea249f54a191b5b
  • Pointer size: 132 Bytes
  • Size of remote file: 1.01 MB
res/model/Lumine/Texture/衣服.png ADDED

Git LFS Details

  • SHA256: 9bd0f2d95bb2a502a5ad4a0fefa1c5ac4c69423ceb2802d29e74ea149073c80d
  • Pointer size: 132 Bytes
  • Size of remote file: 2.8 MB
res/model/Lumine/Texture/表情.png ADDED

Git LFS Details

  • SHA256: fbd77c78e95fbb9e149e969705548017fabc3a169647385acedfdecc38605136
  • Pointer size: 131 Bytes
  • Size of remote file: 137 kB
res/model/Lumine/使用规则.txt ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ �������죬�Ż������͸��壬����UV
3
+
4
+ ===================
5
+ ��������䲼
6
+
7
+ ��������18����Ʒ�������ڽ�������Ѫ�ȿֲ�������Ʒ������������
8
+
9
+ ����������ҵ��;
10
+
11
+ ����ʹ�ñ�ģ������ɵ�һ�в������������ģ�͸�������miHoYo�е�������ʹ����׷��ȫ������
12
+
13
+ ģ�ͱ༭�������
14
+
15
+ ģ�Ͱ�Ȩ����miHoYo
res/track/apdh/audio.m4a ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f1db0302eecb56b5e02b25a2061609666605b6576c786e17adf88023e775d089
3
+ size 9849565
res/track/apdh/audio.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5767ca7429ebec9b3112e687e8e935f444f179d2e02e6e2d822e09b2bb35ff46
3
+ size 42083504
res/track/apdh/hime_motion_-8f.bvmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f23dfa2f61d185a3bc63d3215f9ae5e6dedfe82d77beb27eb832f0f7c90a93b9
3
+ size 13985432
res/track/apdh/hime_motion_-8f.vmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e1092cebdcfe11895691c6beb66fd921c06da7b1db1f4ce7423304b83477f44e
3
+ size 36890132
res/track/apdh/hime_motion_-8f_bake_hutao.bvmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0599f97d7d022e906916abf49b009530380c7f55f224e51419c09bf220d12742
3
+ size 51501580
res/track/apdh/hime_motion_-8f_bake_hutao.vmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:59ce04cbccea20bd0239eda7d7526de300b6fcd04adee497938e96b2b932b832
3
+ size 122124111
res/track/apdh/hina_motion_-8f.bvmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1bf5c8c1a75efd9cd7f857a64b8c1ba8a0ad89d2805c0e0e99cfd82d781aab6b
3
+ size 14428332
res/track/apdh/hina_motion_-8f.vmd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a591791806fb63cdb7f285331e4021f400b4fb1d2536d1e462141df5b0ef8a62
3
+ size 39387112
script.js CHANGED
@@ -51,13 +51,22 @@ const resourcePathSetsDefault = {
51
  };
52
  const resourcePathSets = {
53
  'track': {
 
 
 
 
 
 
 
54
  'conqueror': {
55
  'mainMotion': './res/track/conqueror/merged.bvmd',
56
- 'audio': './res/track/conqueror/audio.m4a'
 
57
  },
58
  'melancholy_night': {
59
  'mainMotion': './res/track/melancholy_night/motion.bvmd',
60
- 'audio': './res/track/melancholy_night/melancholy_night.m4a'
 
61
  }
62
  },
63
  'mainModel': {
@@ -70,25 +79,32 @@ const resourcePathSets = {
70
  'higuchiKaedeOni': './res/model/higuchi_kaede_oni.bpmx',
71
  'higuchiKaedeArmy': './res/model/higuchi_kaede_army.bpmx',
72
  'higuchiKaedeArmyHair': './res/model/higuchi_kaede_army_alt.bpmx',
 
73
  'inuiToko': './res/model/inui_toko.bpmx',
74
- 'lumine': './res/model/Lumine.bpmx',
75
  'miraiAkari': './res/model/MiraiAkari_v1.0.bpmx',
76
  'raidenShogun': './res/model/RaidenShogun.bpmx',
77
  'tokinoSora': './res/model/tokino_sora.bpmx',
78
  'yyb_miku_10th': './res/model/yyb_hatsune_miku_10th_v1.02.bpmx'
79
  }
80
  };
 
81
  const resourcePaths = {
82
  'mainModel': resourcePathSets.mainModel[resourcePathSetsDefault.mainModel],
83
  'mainMotion': resourcePathSets.track[resourcePathSetsDefault.track].mainMotion,
84
  'audio': resourcePathSets.track[resourcePathSetsDefault.track].audio,
85
  };
 
 
 
 
86
  const urlQueryObject = Object.fromEntries(new URLSearchParams(window.location.search));
87
  if (Object.keys(urlQueryObject).some(el => el === 'track')) {
88
  for (let i = 0; i < Object.keys(resourcePathSets.track).length; i++) {
89
  if (urlQueryObject.track === Object.keys(resourcePathSets.track)[i]) {
90
  resourcePaths.mainMotion = resourcePathSets.track[Object.keys(resourcePathSets.track)[i]].mainMotion;
91
  resourcePaths.audio = resourcePathSets.track[Object.keys(resourcePathSets.track)[i]].audio;
 
92
  }
93
  }
94
  }
@@ -96,9 +112,17 @@ if (Object.keys(urlQueryObject).some(el => el === 'mainModel')) {
96
  for (let i = 0; i < Object.keys(resourcePathSets.mainModel).length; i++) {
97
  if (urlQueryObject.mainModel === Object.keys(resourcePathSets.mainModel)[i]) {
98
  resourcePaths.mainModel = resourcePathSets.mainModel[Object.keys(resourcePathSets.mainModel)[i]];
 
99
  }
100
  }
101
  }
 
 
 
 
 
 
 
102
 
103
  var canvas = document.getElementById("renderCanvas");
104
  var startRenderLoop = function (engine, canvas) {
@@ -170,10 +194,10 @@ class Playground {
170
  shadowGenerator.forceBackFacesOnly = true;
171
  shadowGenerator.filteringQuality = BABYLON.ShadowGenerator.QUALITY_MEDIUM;
172
  shadowGenerator.frustumEdgeFalloff = 0.1;
173
- const mmdRuntime = new BABYLONMMD.MmdRuntime(scene, new BABYLONMMD.MmdPhysics(scene));
174
  mmdRuntime.register(scene);
175
  const audioPlayer = new BABYLONMMD.StreamAudioPlayer(scene);
176
- audioPlayer.preservesPitch = false;
177
  audioPlayer.source = resourcePaths.audio;
178
  mmdRuntime.setAudioPlayer(audioPlayer);
179
  const mmdPlayerControl = new BABYLONMMD.MmdPlayerControl(scene, mmdRuntime, audioPlayer);
@@ -188,15 +212,17 @@ class Playground {
188
  const bvmdLoader = new BABYLONMMD.BvmdLoader(scene);
189
  promises.push(bvmdLoader.loadAsync("motion", resourcePaths.mainMotion, (event) => updateLoadingText(0, `Loading motion... ${event.loaded}/${event.total} (${Math.floor((event.loaded * 100) / event.total)}%)`)));
190
  promises.push(BABYLON.SceneLoader.ImportMeshAsync(undefined, resourcePaths.mainModel, undefined, scene, (event) => updateLoadingText(1, `Loading model... ${event.loaded}/${event.total} (${Math.floor((event.loaded * 100) / event.total)}%)`)));
191
- promises.push(
192
- (async () => {
193
- updateLoadingText(2, "Loading physics engine...");
194
- const havokPlugin = new BABYLON.HavokPlugin();
195
- // scene.enablePhysics(new BABYLON.Vector3(0, -9.8, 0), havokPlugin);
196
- scene.enablePhysics(new BABYLON.Vector3(0, -9.8, 0), havokPlugin);
197
- updateLoadingText(2, "Loading physics engine... Done");
198
- })()
199
- );
 
 
200
  loadingTexts = new Array(promises.length).fill("");
201
  const loadResults = await Promise.all(promises);
202
  scene.onAfterRenderObservable.addOnce(() => engine.hideLoadingUI());
 
51
  };
52
  const resourcePathSets = {
53
  'track': {
54
+ 'apdh': {
55
+ 'mainMotion': './res/track/apdh/hime_motion_-8f.bvmd',
56
+ 'audio': './res/track/apdh/audio.m4a',
57
+ 'bakeMotion': {
58
+ // 'hutao': './res/track/apdh/hime_motion_-8f_bake_hutao.bvmd'
59
+ }
60
+ },
61
  'conqueror': {
62
  'mainMotion': './res/track/conqueror/merged.bvmd',
63
+ 'audio': './res/track/conqueror/audio.m4a',
64
+ 'bakeMotion': {}
65
  },
66
  'melancholy_night': {
67
  'mainMotion': './res/track/melancholy_night/motion.bvmd',
68
+ 'audio': './res/track/melancholy_night/melancholy_night.m4a',
69
+ 'bakeMotion': {}
70
  }
71
  },
72
  'mainModel': {
 
79
  'higuchiKaedeOni': './res/model/higuchi_kaede_oni.bpmx',
80
  'higuchiKaedeArmy': './res/model/higuchi_kaede_army.bpmx',
81
  'higuchiKaedeArmyHair': './res/model/higuchi_kaede_army_alt.bpmx',
82
+ 'hutao': './res/model/HuTao/HuTao.pmx',
83
  'inuiToko': './res/model/inui_toko.bpmx',
84
+ 'lumine': './res/model/Lumine/LumineModified.pmx',
85
  'miraiAkari': './res/model/MiraiAkari_v1.0.bpmx',
86
  'raidenShogun': './res/model/RaidenShogun.bpmx',
87
  'tokinoSora': './res/model/tokino_sora.bpmx',
88
  'yyb_miku_10th': './res/model/yyb_hatsune_miku_10th_v1.02.bpmx'
89
  }
90
  };
91
+ let isEnablePhysicsEngine = true;
92
  const resourcePaths = {
93
  'mainModel': resourcePathSets.mainModel[resourcePathSetsDefault.mainModel],
94
  'mainMotion': resourcePathSets.track[resourcePathSetsDefault.track].mainMotion,
95
  'audio': resourcePathSets.track[resourcePathSetsDefault.track].audio,
96
  };
97
+ const resourceNames = {
98
+ 'track': resourcePathSetsDefault.track,
99
+ 'mainModel': resourcePathSetsDefault.mainModel
100
+ };
101
  const urlQueryObject = Object.fromEntries(new URLSearchParams(window.location.search));
102
  if (Object.keys(urlQueryObject).some(el => el === 'track')) {
103
  for (let i = 0; i < Object.keys(resourcePathSets.track).length; i++) {
104
  if (urlQueryObject.track === Object.keys(resourcePathSets.track)[i]) {
105
  resourcePaths.mainMotion = resourcePathSets.track[Object.keys(resourcePathSets.track)[i]].mainMotion;
106
  resourcePaths.audio = resourcePathSets.track[Object.keys(resourcePathSets.track)[i]].audio;
107
+ resourceNames.track = Object.keys(resourcePathSets.track)[i];
108
  }
109
  }
110
  }
 
112
  for (let i = 0; i < Object.keys(resourcePathSets.mainModel).length; i++) {
113
  if (urlQueryObject.mainModel === Object.keys(resourcePathSets.mainModel)[i]) {
114
  resourcePaths.mainModel = resourcePathSets.mainModel[Object.keys(resourcePathSets.mainModel)[i]];
115
+ resourceNames.mainModel = Object.keys(resourcePathSets.mainModel)[i];
116
  }
117
  }
118
  }
119
+ for (let i = 0; i < Object.keys(resourcePathSets.track[resourceNames.track].bakeMotion).length; i++) {
120
+ if (Object.keys(resourcePathSets.track[resourceNames.track].bakeMotion)[i] === resourceNames.mainModel) {
121
+ resourcePaths.mainMotion = resourcePathSets.track[resourceNames.track].bakeMotion[resourceNames.mainModel];
122
+ isEnablePhysicsEngine = false;
123
+ }
124
+ }
125
+ console.log(resourcePaths)
126
 
127
  var canvas = document.getElementById("renderCanvas");
128
  var startRenderLoop = function (engine, canvas) {
 
194
  shadowGenerator.forceBackFacesOnly = true;
195
  shadowGenerator.filteringQuality = BABYLON.ShadowGenerator.QUALITY_MEDIUM;
196
  shadowGenerator.frustumEdgeFalloff = 0.1;
197
+ const mmdRuntime = isEnablePhysicsEngine ? new BABYLONMMD.MmdRuntime(scene, new BABYLONMMD.MmdPhysics(scene)) : new BABYLONMMD.MmdRuntime(scene)
198
  mmdRuntime.register(scene);
199
  const audioPlayer = new BABYLONMMD.StreamAudioPlayer(scene);
200
+ audioPlayer.preservesPitch = true;
201
  audioPlayer.source = resourcePaths.audio;
202
  mmdRuntime.setAudioPlayer(audioPlayer);
203
  const mmdPlayerControl = new BABYLONMMD.MmdPlayerControl(scene, mmdRuntime, audioPlayer);
 
212
  const bvmdLoader = new BABYLONMMD.BvmdLoader(scene);
213
  promises.push(bvmdLoader.loadAsync("motion", resourcePaths.mainMotion, (event) => updateLoadingText(0, `Loading motion... ${event.loaded}/${event.total} (${Math.floor((event.loaded * 100) / event.total)}%)`)));
214
  promises.push(BABYLON.SceneLoader.ImportMeshAsync(undefined, resourcePaths.mainModel, undefined, scene, (event) => updateLoadingText(1, `Loading model... ${event.loaded}/${event.total} (${Math.floor((event.loaded * 100) / event.total)}%)`)));
215
+ if (isEnablePhysicsEngine === true) {
216
+ promises.push(
217
+ (async () => {
218
+ updateLoadingText(2, "Loading physics engine...");
219
+ const havokPlugin = new BABYLON.HavokPlugin();
220
+ // scene.enablePhysics(new BABYLON.Vector3(0, -9.8, 0), havokPlugin);
221
+ scene.enablePhysics(new BABYLON.Vector3(0, -9.8, 0), havokPlugin);
222
+ updateLoadingText(2, "Loading physics engine... Done");
223
+ })()
224
+ );
225
+ }
226
  loadingTexts = new Array(promises.length).fill("");
227
  const loadResults = await Promise.all(promises);
228
  scene.onAfterRenderObservable.addOnce(() => engine.hideLoadingUI());