# How God’s Eye View Caps the CesiumJS Render Loop at 60 FPS for Performance

> Discover how God's Eye View caps the CesiumJS render loop at 60 FPS using requestRenderMode for optimal performance by preventing unnecessary GPU load on static scenes.

- Repository: [Bilawal Sidhu/gods-eye-view](https://github.com/bilawalsidhu/gods-eye-view)
- Tags: performance
- Published: 2026-09-09

---

**God’s Eye View leverages CesiumJS’s `requestRenderMode` and `maximumRenderTimeChange` options to throttle the render loop to a maximum of 60 frames per second, eliminating unnecessary GPU work when the 3D scene is static.**

The open-source **bilawalsidhu/gods-eye-view** repository visualizes complex geospatial datasets using CesiumJS, where unchecked render loops can drain battery and overheat GPUs during idle periods. By configuring the Cesium Viewer initialization in [`src/main.js`](https://github.com/bilawalsidhu/gods-eye-view/blob/main/src/main.js), the project enforces a hard 60 FPS ceiling that respects browser paint scheduling while maintaining smooth interactivity during camera movements and layer updates.

## Understanding CesiumJS Render Loop Throttling

CesiumJS defaults to a continuous `requestAnimationFrame` loop that redraws as fast as hardware allows, often exceeding 60 FPS on high-refresh displays. To **cap the CesiumJS render loop at 60 FPS**, God’s Eye View passes two critical configuration options to the Viewer constructor:

- **`requestRenderMode`**: When set to `true`, this switches the engine from continuous rendering to demand-based rendering. Frames are only drawn when the camera, entities, or imagery layers change.
- **`maximumRenderTimeChange`**: Set to `1 / 60` (approximately 0.0167 seconds), this defines the maximum allowed interval between render calls, effectively enforcing the **60 FPS limit** even during active interaction.

This combination ensures that if the globe is idle, Cesium skips frames entirely rather than wasting cycles re-drawing identical pixels.

## Implementation in the Source Code

### Viewer Initialization in src/main.js

The primary configuration occurs when instantiating the global `viewer` object. In [`src/main.js`](https://github.com/bilawalsidhu/gods-eye-view/blob/main/src/main.js), the constructor receives the throttling parameters that activate the capped render loop:

```javascript
// src/main.js
const viewer = new Cesium.Viewer('cesiumContainer', {
  requestRenderMode: true,
  maximumRenderTimeChange: 1 / 60,
  // additional Cesium configuration...
});

```

By enabling `requestRenderMode`, the code disables Cesium’s default behavior of calling `requestAnimationFrame` indefinitely. The `maximumRenderTimeChange` parameter guarantees that even when continuous updates are required—such as during camera flights—the engine never exceeds the 60 FPS budget.

### Camera and Scene Updates

When `requestRenderMode` is active, Cesium relies on explicit change notifications to trigger new frames. The repository handles camera movements and layer updates in [`src/camera.js`](https://github.com/bilawalsidhu/gods-eye-view/blob/main/src/camera.js), where interactions forcing a re-render include:

- User zoom or rotate operations
- Terrain tile loading completions
- Entity property modifications

These events implicitly call `viewer.scene.requestRender()`, queuing a single frame that respects the `maximumRenderTimeChange` constraint defined in the initialization. For heavy UI operations, optional governor logic in [`src/renderGovernor.js`](https://github.com/bilawalsidhu/gods-eye-view/blob/main/src/renderGovernor.js) may further suppress unnecessary render calls.

## Runtime Configuration and Animation Overrides

While the default cap improves battery life, certain workflows—such as high-speed flythroughs—require temporary frame-rate boosts. You can dynamically adjust the **CesiumJS 60 FPS cap** at runtime by modifying the Scene instance:

```javascript
// Temporarily increase to 120 FPS for smooth animation
viewer.scene.requestRenderMode = false;
viewer.scene.maximumRenderTimeChange = 1 / 120;

// Re-enable the 60 FPS cap after animation completes
viewer.scene.requestRenderMode = true;
viewer.scene.maximumRenderTimeChange = 1 / 60;

```

This approach allows God’s Eye View to balance performance and visual fidelity without restarting the Viewer or reloading terrain tiles.

## Summary

- God’s Eye View configures CesiumJS with `requestRenderMode: true` and `maximumRenderTimeChange: 1/60` in [`src/main.js`](https://github.com/bilawalsidhu/gods-eye-view/blob/main/src/main.js) to enforce a 60 FPS ceiling.
- The `requestRenderMode` option eliminates redundant rendering when the scene is static, reducing GPU utilization during idle periods.
- `maximumRenderTimeChange` guarantees the frame rate never exceeds 60 FPS, even during continuous camera movement or data updates.
- Runtime adjustments to `viewer.scene.maximumRenderTimeChange` allow temporary frame-rate increases for specific animations or high-refresh displays.

## Frequently Asked Questions

### What does `requestRenderMode` do in CesiumJS?

`requestRenderMode` converts Cesium from a continuous render loop to a demand-based system. When enabled, the engine only schedules new frames after detecting changes to the camera, entities, or imagery layers, significantly reducing CPU and GPU load during idle states according to the God’s Eye View source code.

### How does `maximumRenderTimeChange` limit frame rate?

`maximumRenderTimeChange` specifies the maximum time in seconds that should elapse between render calls. Setting this value to `1/60` ensures Cesium never renders more than 60 frames per second, effectively capping the refresh rate regardless of display capabilities or hardware performance.

### Can I disable the 60 FPS cap for high-refresh monitors?

Yes. You can disable the cap by setting `viewer.scene.requestRenderMode = false`, which restores Cesium’s default unlimited frame-rate behavior, or by decreasing `maximumRenderTimeChange` to `1/120` or `1/144` to match high-refresh displays. These properties can be toggled at runtime without reinitializing the Viewer.

### Where is the render loop configured in God’s Eye View?

The render loop configuration resides in [`src/main.js`](https://github.com/bilawalsidhu/gods-eye-view/blob/main/src/main.js), where the `Cesium.Viewer` constructor receives the `requestRenderMode` and `maximumRenderTimeChange` options. Camera interactions that trigger re-renders are handled in [`src/camera.js`](https://github.com/bilawalsidhu/gods-eye-view/blob/main/src/camera.js), while optional governor logic may reside in [`src/renderGovernor.js`](https://github.com/bilawalsidhu/gods-eye-view/blob/main/src/renderGovernor.js) to pause rendering during intensive UI operations.