Update RunnerCanvas and RuntimeHost to handle runtime clock state changes more efficiently

This commit is contained in:
2026-04-12 14:57:02 +02:00
parent d843a3bc67
commit 2aeb38d97c
2 changed files with 51 additions and 5 deletions

View File

@@ -126,6 +126,7 @@ interface RuntimeWaterContactUniformBinding {
const FALLBACK_FACE_COLOR = 0xf2ece2;
const BOX_FACE_MATERIAL_COUNT = 6;
const RUNTIME_CLOCK_PUBLISH_INTERVAL_SECONDS = 1 / 30;
const WATER_REFLECTION_UPDATE_INTERVAL_MS = 96;
function dampScalar(current: number, target: number, rate: number, dt: number) {
@@ -1854,7 +1855,7 @@ export class RuntimeHost {
this.applyDayNightLighting();
this.clockPublishAccumulator += dt;
if (this.clockPublishAccumulator >= 0.25) {
if (this.clockPublishAccumulator >= RUNTIME_CLOCK_PUBLISH_INTERVAL_SECONDS) {
this.clockPublishAccumulator = 0;
this.publishRuntimeClockState();
}