improve fps and geometry debug display
This commit is contained in:
parent
64a244f151
commit
0dbafda6b0
2 changed files with 14 additions and 5 deletions
|
|
@ -228,8 +228,8 @@ gapp.register("kiri.init", [], (root, exports) => {
|
||||||
let { div, fps, rms, rnfo } = ui.stats;
|
let { div, fps, rms, rnfo } = ui.stats;
|
||||||
div.style.display = 'flex';
|
div.style.display = 'flex';
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
const nfps = space.view.getFPS().toFixed(2);
|
const nrms = space.view.getRMS().toFixed(1);
|
||||||
const nrms = space.view.getRMS().toFixed(2);
|
const nfps = space.view.getFPS().toFixed(1);
|
||||||
const rend = space.renderInfo();
|
const rend = space.renderInfo();
|
||||||
const { memory, render } = rend;
|
const { memory, render } = rend;
|
||||||
if (nfps !== fps.innerText) {
|
if (nfps !== fps.innerText) {
|
||||||
|
|
@ -239,7 +239,9 @@ gapp.register("kiri.init", [], (root, exports) => {
|
||||||
rms.innerText = nrms;
|
rms.innerText = nrms;
|
||||||
}
|
}
|
||||||
if (rnfo.offsetParent !== null) {
|
if (rnfo.offsetParent !== null) {
|
||||||
rnfo.innerText = JSON.stringify({ ...memory, ...render }, null, 4);
|
rnfo.innerHTML = Object.entries({ ...memory, ...render }).map(row => {
|
||||||
|
return `<div>${row[0]}</div><label>${base.util.comma(row[1])}</label>`
|
||||||
|
}).join('');
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1812,17 +1812,24 @@ th, tr, td, label {
|
||||||
color: #888;
|
color: #888;
|
||||||
}
|
}
|
||||||
#stats:hover #rnfo {
|
#stats:hover #rnfo {
|
||||||
display: flex;
|
display: grid;
|
||||||
}
|
}
|
||||||
#rnfo {
|
#rnfo {
|
||||||
display: none;
|
display: none;
|
||||||
|
grid-template-columns: min-content 1fr;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 100%;
|
bottom: 100%;
|
||||||
|
gap: 3px;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
color: #ddd;
|
||||||
|
background-color: rgba(255,255,255,0.05);
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
white-space: pre;
|
x-white-space: pre;
|
||||||
|
}
|
||||||
|
#rnfo label {
|
||||||
|
text-align: right;
|
||||||
}
|
}
|
||||||
#tool-info {
|
#tool-info {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue