# Standalone Node Scripts for Headless Rendering in Gods Eye View

> Discover Gods Eye View's standalone Node scripts for headless rendering. Generate Cesium 3D globe images using Puppeteer and headless Chromium without a browser UI. Learn more!

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

---

**Gods Eye View provides five self-contained Node.js scripts in the `tools/` directory that bootstrap a minimal HTTP server, launch headless Chromium via Puppeteer, and render Cesium 3D globe views to static images without opening a browser UI.**

Gods Eye View (github.com/bilawalsidhu/gods-eye-view) ships with specialized command-line utilities for automated visual asset generation. These **standalone Node scripts for headless rendering** enable CI pipelines and batch processing workflows to capture satellite imagery, street-view panoramas, and orthographic projections directly from the terminal without manual interaction.

## Architecture of the Headless Rendering System

The scripts share a unified architecture designed for software-based GPU rendering on headless servers. Each module follows a deterministic five-stage pipeline to ensure consistent output across environments.

### Minimal HTTP Server Bootstrap

Each script starts a lightweight HTTP server that hosts Cesium assets and a minimal HTML entry point. This local server delivers the Gods Eye View client code to the browser instance, ensuring all required WebAssembly and texture resources are available during rendering.

### Puppeteer and SwiftShader Integration

The scripts launch Chromium using Puppeteer with `headless: 'new'` (or `headless: true`), leveraging SwiftShader's software OpenGL implementation. This configuration provides a complete WebGL pipeline without requiring physical GPU hardware, making the tools compatible with CI machines and cloud containers.

### Camera Parameter Injection and LOD Management

Once the page loads, the scripts programmatically inject camera coordinates—**latitude**, **longitude**, **heading**, **pitch**, and **height**—through the GEV client API. They progressively lower the screen-space error (SSE) threshold to force Cesium to load higher detail levels (LOD) until the scene reaches the requested visual fidelity.

### Frame Capture and Output

After a short settle period to ensure terrain and imagery complete loading, the scripts read the canvas data and write JPEG or PNG files to the `output/` directory. All file operations are synchronous and atomic, preventing partial writes during batch operations.

## Available Headless Rendering Scripts

The repository maintains five pure ES modules (`.mjs` files) in the `tools/` directory, each designed for a specific rendering task.

### cesium-render.mjs

Located at `tools/cesium-render.mjs`, this script renders a specific camera view of the Cesium 3D globe to a static image. It accepts precise positioning parameters and output dimensions, making it ideal for generating marketing screenshots or geographic previews.

### streetview-panorama.mjs

Found at `tools/streetview-panorama.mjs`, this utility captures 360-degree Street View panoramas for specified GPS coordinates. It outputs equirectangular images suitable for VR applications or further conversion via the pinhole projection tool.

### streetview-headings.mjs

The `tools/streetview-headings.mjs` script computes optimal heading angles for batches of street-view locations. It reads input coordinates from CSV files and outputs orientation data, enabling automated capture sequences that face specific directions.

### sat-ortho.mjs

At `tools/sat-ortho.mjs`, this tool generates orthographic satellite snapshots of geographic regions. It supports configurable zoom levels and output dimensions, producing map tiles or regional overviews without perspective distortion.

### pano-pinhole.mjs

The `tools/pano-pinhole.mjs` script converts existing equirectangular panoramas into standard pinhole-projection photographs. It accepts a field-of-view parameter to simulate different camera lenses from the raw 360° source material.

## Command Line Usage Examples

Each script supports the `--help` flag to display available options and default values. Below are practical invocations for common automated rendering workflows.

Rendering a fixed Cesium scene with specific camera positioning:

```bash
node tools/cesium-render.mjs \
  --lat 30.266476 --lon -97.73719 \
  --heading 270 --pitch -15 --height 8 \
  --width 1920 --height-px 1080 \
  --key YOUR_GOOGLE_MAPS_API_KEY

```

Generating a 360-degree Street View panorama for a specific location:

```bash
node tools/streetview-panorama.mjs \
  --lat 37.7749 --lon -122.4194 \
  --heading 0 --fov 120 \
  --outdir panoramas/

```

Batch processing heading calculations from a CSV file:

```bash
node tools/streetview-headings.mjs \
  --input locations.csv \
  --output headings.csv

```

Creating an orthographic satellite image of a geographic region:

```bash
node tools/sat-ortho.mjs \
  --lat 45.0 --lon 10.0 \
  --zoom 5 --size 1024 \
  --key YOUR_GOOGLE_MAPS_API_KEY

```

Converting a panoramic image to a pinhole projection:

```bash
node tools/pano-pinhole.mjs \
  --input panorama.jpg \
  --fov 90 --output pinhole.jpg

```

## Integration Considerations

All scripts are pure Node modules with no external side effects, making them safe for CI/CD pipelines and automated cron jobs. They require Node.js and the Puppeteer dependency, which automatically downloads compatible Chromium binaries on first execution. The SwiftShader-based software renderer ensures these tools function correctly in containerized environments such as Docker or Kubernetes clusters lacking display hardware or X11 servers.

## Summary

- Gods Eye View provides **five standalone Node scripts** for automated headless rendering located in the `tools/` directory.
- Each script follows a consistent architecture: HTTP server bootstrap, Puppeteer-controlled Chromium with `headless: 'new'`, camera injection, LOD management, and frame capture.
- **Key scripts** include `cesium-render.mjs` for 3D globe views, `streetview-panorama.mjs` for 360° captures, and `sat-ortho.mjs` for orthographic satellite imagery.
- All utilities support standard CLI flags for geographic coordinates, camera orientation (`--heading`, `--pitch`), and output configuration.
- The **SwiftShader-based software renderer** enables GPU-free operation on headless servers and continuous integration machines.

## Frequently Asked Questions

### Can these scripts run on a server without a GPU?

Yes. The scripts use Puppeteer's `headless: 'new'` mode with Chromium's SwiftShader software OpenGL implementation. This provides a full WebGL rendering context without requiring dedicated graphics hardware or display servers, making them suitable for cloud instances and CI runners.

### What image formats do the headless rendering scripts output?

The scripts primarily output JPEG and PNG formats. For example, `cesium-render.mjs` writes JPEG files to the `output/` directory, while `pano-pinhole.mjs` generates standard pinhole-projection photographs from input panoramas. Format selection is typically controlled via file extensions in the output path or dedicated `--format` flags where applicable.

### How do I specify camera orientation when rendering a specific location?

Use the `--heading`, `--pitch`, and `--height` parameters available in `cesium-render.mjs` and `streetview-panorama.mjs`. The heading value represents compass direction in degrees (0-360), pitch controls the vertical tilt, and height sets the camera altitude above ground level.

### Are these scripts suitable for batch processing multiple locations?

Yes. The `streetview-headings.mjs` script specifically supports CSV input for batch operations, processing multiple latitude/longitude pairs sequentially. Additionally, all scripts can be wrapped in shell loops or orchestrated via CI pipelines since they are pure Node modules with no interactive requirements and deterministic exit codes.