Spaces:
Running
Running
upd
Browse files- res/model/{Lumine.bpmx → HuTao/HuTao.pmx} +2 -2
- res/model/HuTao/hair.bmp +3 -0
- res/model/HuTao/skin.bmp +3 -0
- res/model/HuTao/skin_old.bmp +3 -0
- res/model/HuTao/tex/发.png +3 -0
- res/model/HuTao/tex/服.png +3 -0
- res/model/HuTao/tex/面.png +3 -0
- res/model/HuTao/toon_defo.bmp +3 -0
- res/model/Lumine/Lumine.pmx +3 -0
- res/model/Lumine/LumineModified.pmx +3 -0
- res/model/Lumine/Texture/mc3.png +3 -0
- res/model/Lumine/Texture/toon.png +3 -0
- res/model/Lumine/Texture/toon02.bmp +3 -0
- res/model/Lumine/Texture/toon02_75.png +3 -0
- res/model/Lumine/Texture/头发.png +3 -0
- res/model/Lumine/Texture/脸.png +3 -0
- res/model/Lumine/Texture/衣服.png +3 -0
- res/model/Lumine/Texture/表情.png +3 -0
- res/model/Lumine/使用规则.txt +15 -0
- res/track/apdh/audio.m4a +3 -0
- res/track/apdh/audio.wav +3 -0
- res/track/apdh/hime_motion_-8f.bvmd +3 -0
- res/track/apdh/hime_motion_-8f.vmd +3 -0
- res/track/apdh/hime_motion_-8f_bake_hutao.bvmd +3 -0
- res/track/apdh/hime_motion_-8f_bake_hutao.vmd +3 -0
- res/track/apdh/hina_motion_-8f.bvmd +3 -0
- res/track/apdh/hina_motion_-8f.vmd +3 -0
- script.js +40 -14
res/model/{Lumine.bpmx → HuTao/HuTao.pmx}
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
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
|
res/model/HuTao/skin.bmp
ADDED
![]() |
Git LFS Details
|
res/model/HuTao/skin_old.bmp
ADDED
![]() |
Git LFS Details
|
res/model/HuTao/tex/发.png
ADDED
![]() |
Git LFS Details
|
res/model/HuTao/tex/服.png
ADDED
![]() |
Git LFS Details
|
res/model/HuTao/tex/面.png
ADDED
![]() |
Git LFS Details
|
res/model/HuTao/toon_defo.bmp
ADDED
![]() |
Git LFS Details
|
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
|
res/model/Lumine/Texture/toon.png
ADDED
![]() |
Git LFS Details
|
res/model/Lumine/Texture/toon02.bmp
ADDED
![]() |
Git LFS Details
|
res/model/Lumine/Texture/toon02_75.png
ADDED
![]() |
Git LFS Details
|
res/model/Lumine/Texture/头发.png
ADDED
![]() |
Git LFS Details
|
res/model/Lumine/Texture/脸.png
ADDED
![]() |
Git LFS Details
|
res/model/Lumine/Texture/衣服.png
ADDED
![]() |
Git LFS Details
|
res/model/Lumine/Texture/表情.png
ADDED
![]() |
Git LFS Details
|
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.
|
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 =
|
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 |
-
|
192 |
-
(
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
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());
|