spoint 0.1.678 → 0.1.680
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/apps/world/tps-game.js +10 -10
- package/client/app.js +9 -0
- package/client/core/SceneSetup.js +2 -2
- package/client/core/Vegetation.js +2 -2
- package/package.json +1 -1
package/apps/world/tps-game.js
CHANGED
|
@@ -72,18 +72,18 @@ export default {
|
|
|
72
72
|
feetOffset: 0.212
|
|
73
73
|
},
|
|
74
74
|
scene: {
|
|
75
|
-
skyColor:
|
|
76
|
-
fogColor:
|
|
75
|
+
skyColor: 0xff9a5c,
|
|
76
|
+
fogColor: 0xffb389,
|
|
77
77
|
fogNear: 10000,
|
|
78
78
|
fogFar: 20000,
|
|
79
|
-
ambientColor:
|
|
80
|
-
ambientIntensity: 0.
|
|
81
|
-
sunColor:
|
|
82
|
-
sunIntensity: 1.
|
|
83
|
-
sunPosition: [
|
|
84
|
-
fillColor:
|
|
85
|
-
fillIntensity: 0.
|
|
86
|
-
fillPosition: [-
|
|
79
|
+
ambientColor: 0xffcf9e,
|
|
80
|
+
ambientIntensity: 0.55,
|
|
81
|
+
sunColor: 0xffa552,
|
|
82
|
+
sunIntensity: 1.8,
|
|
83
|
+
sunPosition: [65, 8, 20],
|
|
84
|
+
fillColor: 0xff5f8e,
|
|
85
|
+
fillIntensity: 0.6,
|
|
86
|
+
fillPosition: [-65, 14, -20],
|
|
87
87
|
shadowMapSize: 1024,
|
|
88
88
|
shadowBias: -0.0005,
|
|
89
89
|
shadowNormalBias: 0.05,
|
package/client/app.js
CHANGED
|
@@ -2423,6 +2423,15 @@ function startInputLoop() {
|
|
|
2423
2423
|
}, 1000/60)
|
|
2424
2424
|
}
|
|
2425
2425
|
renderer.domElement.addEventListener('click', ()=>{ if (inputConfig.pointerLock&&!document.pointerLockElement) renderer.domElement.requestPointerLock() })
|
|
2426
|
+
// requestPointerLock() is a trusted-gesture-gated browser API that can silently reject (denied
|
|
2427
|
+
// engagement heuristic, automation-driven click, embedded/iframe context) with no visible error --
|
|
2428
|
+
// the click-prompt overlay then never dismisses and gameplay looks permanently blocked even though
|
|
2429
|
+
// the scene itself is live. Any WASD/movement keydown is unambiguous "I am playing" intent, so treat
|
|
2430
|
+
// it as an implicit prompt-dismissal fallback independent of whether the lock request ever resolved.
|
|
2431
|
+
document.addEventListener('keydown', e => {
|
|
2432
|
+
if (clickPrompt.style.display==='none' || !inputConfig.pointerLock) return
|
|
2433
|
+
if (['KeyW','KeyA','KeyS','KeyD','Space'].includes(e.code)) clickPrompt.style.display='none'
|
|
2434
|
+
})
|
|
2426
2435
|
document.addEventListener('pointerlockchange', ()=>{
|
|
2427
2436
|
const locked=document.pointerLockElement===renderer.domElement
|
|
2428
2437
|
clickPrompt.style.display=locked?'none':(inputConfig.pointerLock?'block':'none')
|
|
@@ -184,7 +184,7 @@ export async function probeOffscreenCanvasWorkerRendering() {
|
|
|
184
184
|
function _applyCommonRendererSetup(renderer, isMobile) {
|
|
185
185
|
renderer.setSize(window.innerWidth, window.innerHeight)
|
|
186
186
|
renderer.setPixelRatio(isMobile ? Math.min(window.devicePixelRatio * 0.5, 1) : Math.min(window.devicePixelRatio, 2))
|
|
187
|
-
renderer.shadowMap.enabled =
|
|
187
|
+
renderer.shadowMap.enabled = false
|
|
188
188
|
renderer.shadowMap.type = THREE.PCFShadowMap // not PCFSoft: this build is fragment-bound, soft kernel too costly
|
|
189
189
|
// Temporal throttle: shadow map (and every InstancedMesh2 BVH cull three.js runs against the shadow
|
|
190
190
|
// camera during that pass, incl. all vegetation) only re-renders when app.js's animate() loop flips
|
|
@@ -297,7 +297,7 @@ export function setupLights(scene) {
|
|
|
297
297
|
studio.position.set(-20, 30, -10); studio.castShadow = false; scene.add(studio)
|
|
298
298
|
// studio keeps matrixAutoUpdate=true (default): applySceneConfig's fillPosition can move it post-boot
|
|
299
299
|
const sun = new THREE.DirectionalLight(0xffffff, 1.5)
|
|
300
|
-
sun.position.set(21, 50, 20); sun.castShadow =
|
|
300
|
+
sun.position.set(21, 50, 20); sun.castShadow = false
|
|
301
301
|
sun.shadow.mapSize.set(1024, 1024)
|
|
302
302
|
sun.shadow.bias = -0.0005
|
|
303
303
|
sun.shadow.normalBias = 0.05
|
|
@@ -203,9 +203,9 @@ export async function createVegetation(opts = {}) {
|
|
|
203
203
|
const recByName = new Map(meshes.map(r => [r.name, r]))
|
|
204
204
|
|
|
205
205
|
// Must apply mip/alpha setup AFTER every impostor bake (leafMat renders into a non-multisampled RT during the bake, where A2C is undefined-ish).
|
|
206
|
-
//
|
|
206
|
+
// Anisotropy pinned to 1 (Performance-Mode reference: no anisotropic softening at distance); alphaToCoverage on the leaf cutout when the renderer has real MSAA, alphaTest stays 0.5 for the no-MSAA shadow pass.
|
|
207
207
|
try {
|
|
208
|
-
const maxAniso =
|
|
208
|
+
const maxAniso = 1
|
|
209
209
|
const hasMSAA = !!(renderer.getContext() && renderer.getContext().getContextAttributes && renderer.getContext().getContextAttributes().antialias)
|
|
210
210
|
for (const r of meshes) {
|
|
211
211
|
for (const m of [r.branch && r.branch.material, r.leaf && r.leaf.material]) {
|