forked from Timmy_Foundation/the-nexus
Nexus v1: complete Three.js environment with Batcave terminal, portal, chat, skybox
This commit is contained in:
9
app.js
9
app.js
@@ -951,15 +951,15 @@ function gameLoop() {
|
||||
}
|
||||
|
||||
// Render
|
||||
renderer.info.reset();
|
||||
composer.render();
|
||||
|
||||
// Debug overlay
|
||||
// Debug overlay (read AFTER render so counts are populated)
|
||||
frameCount++;
|
||||
if (performance.now() - lastFPSTime >= 1000) {
|
||||
const now = performance.now();
|
||||
if (now - lastFPSTime >= 1000) {
|
||||
fps = frameCount;
|
||||
frameCount = 0;
|
||||
lastFPSTime = performance.now();
|
||||
lastFPSTime = now;
|
||||
}
|
||||
if (debugOverlay) {
|
||||
const info = renderer.info;
|
||||
@@ -967,6 +967,7 @@ function gameLoop() {
|
||||
`FPS: ${fps} Draw: ${info.render?.calls} Tri: ${info.render?.triangles}\n` +
|
||||
`Pos: ${playerPos.x.toFixed(1)}, ${playerPos.y.toFixed(1)}, ${playerPos.z.toFixed(1)}`;
|
||||
}
|
||||
renderer.info.reset();
|
||||
}
|
||||
|
||||
// ═══ RESIZE ═══
|
||||
|
||||
Reference in New Issue
Block a user