spoint 0.1.30 → 0.1.31
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/client/app.js +17 -1
- package/package.json +1 -1
package/client/app.js
CHANGED
|
@@ -750,6 +750,10 @@ async function createPlayerVRM(id) {
|
|
|
750
750
|
if (head) cam.setHeadBone(head)
|
|
751
751
|
if (cam.getMode() === 'fps' && head) head.scale.set(0, 0, 0)
|
|
752
752
|
}
|
|
753
|
+
if (!_vrmWarmupDone) {
|
|
754
|
+
_vrmWarmupDone = true
|
|
755
|
+
requestAnimationFrame(() => { renderer.compile(scene, camera); console.log('[shader] vrm warmup compile done') })
|
|
756
|
+
}
|
|
753
757
|
} catch (e) { console.error('[vrm]', id, e.message) }
|
|
754
758
|
return group
|
|
755
759
|
}
|
|
@@ -1066,6 +1070,18 @@ let firstSnapshotReceived = false
|
|
|
1066
1070
|
let lastShootState = false
|
|
1067
1071
|
let lastHealth = 100
|
|
1068
1072
|
|
|
1073
|
+
let _shaderWarmupDone = false
|
|
1074
|
+
let _vrmWarmupDone = false
|
|
1075
|
+
|
|
1076
|
+
function warmupShaders() {
|
|
1077
|
+
if (_shaderWarmupDone) return
|
|
1078
|
+
_shaderWarmupDone = true
|
|
1079
|
+
const ext = renderer.extensions.get('KHR_parallel_shader_compile')
|
|
1080
|
+
if (ext) console.log('[shader] KHR_parallel_shader_compile active')
|
|
1081
|
+
renderer.compile(scene, camera)
|
|
1082
|
+
console.log('[shader] warmup compile done')
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1069
1085
|
function checkAllLoaded() {
|
|
1070
1086
|
if (loadingScreenHidden) return
|
|
1071
1087
|
if (!assetsLoaded) return
|
|
@@ -1073,7 +1089,7 @@ function checkAllLoaded() {
|
|
|
1073
1089
|
if (!firstSnapshotReceived) return
|
|
1074
1090
|
loadingMgr.setStage('INIT')
|
|
1075
1091
|
loadingMgr.complete()
|
|
1076
|
-
loadingScreen.hide().catch(() =>
|
|
1092
|
+
loadingScreen.hide().then(() => requestAnimationFrame(warmupShaders)).catch(() => requestAnimationFrame(warmupShaders))
|
|
1077
1093
|
loadingScreenHidden = true
|
|
1078
1094
|
}
|
|
1079
1095
|
|