Spaces:
Running
Running
Edit
Browse files
script.js
CHANGED
@@ -122,10 +122,13 @@ class Playground {
|
|
122 |
babylonMmdScript.onload = resolve;
|
123 |
});
|
124 |
if (engine.hostInformation.isMobile) {engine.setHardwareScalingLevel(0.85)} else {engine.setHardwareScalingLevel(0.75)}
|
|
|
|
|
|
|
125 |
const pmxLoader = BABYLON.SceneLoader.GetPluginForExtension(".pmx");
|
126 |
const materialBuilder = pmxLoader.materialBuilder;
|
127 |
materialBuilder.useAlphaEvaluation = false;
|
128 |
-
materialBuilder.loadOutlineRenderingProperties
|
129 |
// const alphaBlendMaterials = ["face02", "Facial02", "HL", "Hairshadow", "q302"];
|
130 |
// const alphaTestMaterials = ["q301"];
|
131 |
// materialBuilder.afterBuildSingleMaterial = (material) => {
|
@@ -205,6 +208,7 @@ class Playground {
|
|
205 |
const mmdModel = mmdRuntime.createMmdModel(modelMesh);
|
206 |
mmdModel.addAnimation(loadResults[0]);
|
207 |
mmdModel.setAnimation("motion");
|
|
|
208 |
const bodyBone = loadResults[1].skeletons[0].bones.find((bone) => bone.name === "センター");
|
209 |
scene.onBeforeRenderObservable.add(() => {
|
210 |
bodyBone.getFinalMatrix().getTranslationToRef(directionalLight.position);
|
@@ -301,9 +305,9 @@ ${mathFunc.rounder('floor', engine.performanceMonitor.averageFrameTime, 2)} ms`;
|
|
301 |
textblock.text = `${engine._glRenderer}
|
302 |
${engine._glVersion}
|
303 |
|
304 |
-
Main Model Path:
|
305 |
-
Main Motion Path:
|
306 |
-
Main Audio Path:
|
307 |
|
308 |
FPS Disp: ${mathFunc.rounder('floor', engine.performanceMonitor.averageFPS, 2, true)} fps avg (${mathFunc.rounder('floor', engine.performanceMonitor.instantaneousFPS, 2, true)} fps)
|
309 |
FPS Limit: ${isLimitFPS ? mathFunc.rounder('floor', parseFloat(urlQueryObject.fps), 2, true) + ' fps' : 'unlimited'}
|
@@ -333,7 +337,6 @@ Heap: ${!performance.memory ? 'Unavailable' : (mathFunc.rounder('ceil', performa
|
|
333 |
}, 10);
|
334 |
await new Promise(resolve => setTimeout(resolve, 1000));
|
335 |
mmdRuntime.playAnimation();
|
336 |
-
console.log(sceneInstrumentation)
|
337 |
return scene;
|
338 |
}
|
339 |
}
|
|
|
122 |
babylonMmdScript.onload = resolve;
|
123 |
});
|
124 |
if (engine.hostInformation.isMobile) {engine.setHardwareScalingLevel(0.85)} else {engine.setHardwareScalingLevel(0.75)}
|
125 |
+
if (Object.keys(urlQueryObject).some(el => el === 'scale')) {
|
126 |
+
engine.setHardwareScalingLevel(parseFloat(urlQueryObject.scale));
|
127 |
+
}
|
128 |
const pmxLoader = BABYLON.SceneLoader.GetPluginForExtension(".pmx");
|
129 |
const materialBuilder = pmxLoader.materialBuilder;
|
130 |
materialBuilder.useAlphaEvaluation = false;
|
131 |
+
// materialBuilder.loadOutlineRenderingProperties;
|
132 |
// const alphaBlendMaterials = ["face02", "Facial02", "HL", "Hairshadow", "q302"];
|
133 |
// const alphaTestMaterials = ["q301"];
|
134 |
// materialBuilder.afterBuildSingleMaterial = (material) => {
|
|
|
208 |
const mmdModel = mmdRuntime.createMmdModel(modelMesh);
|
209 |
mmdModel.addAnimation(loadResults[0]);
|
210 |
mmdModel.setAnimation("motion");
|
211 |
+
// mmdModel.mesh.outlineWidth = 10
|
212 |
const bodyBone = loadResults[1].skeletons[0].bones.find((bone) => bone.name === "センター");
|
213 |
scene.onBeforeRenderObservable.add(() => {
|
214 |
bodyBone.getFinalMatrix().getTranslationToRef(directionalLight.position);
|
|
|
305 |
textblock.text = `${engine._glRenderer}
|
306 |
${engine._glVersion}
|
307 |
|
308 |
+
Main Model Path: ${resourcePaths.mainModel}
|
309 |
+
Main Motion Path: ${resourcePaths.mainMotion}
|
310 |
+
Main Audio Path: ${resourcePaths.audio}
|
311 |
|
312 |
FPS Disp: ${mathFunc.rounder('floor', engine.performanceMonitor.averageFPS, 2, true)} fps avg (${mathFunc.rounder('floor', engine.performanceMonitor.instantaneousFPS, 2, true)} fps)
|
313 |
FPS Limit: ${isLimitFPS ? mathFunc.rounder('floor', parseFloat(urlQueryObject.fps), 2, true) + ' fps' : 'unlimited'}
|
|
|
337 |
}, 10);
|
338 |
await new Promise(resolve => setTimeout(resolve, 1000));
|
339 |
mmdRuntime.playAnimation();
|
|
|
340 |
return scene;
|
341 |
}
|
342 |
}
|