forge3d solves a real problem: how to deliver a GPU-accelerated 3D rendering engine built in Rust to Python users without making them wrestle with Rust compilation or GPU dependencies. It exposes a performant wgpu/WebGPU backend as pre-compiled Python wheels, giving terrain and point cloud visualization capabilities with an async API that fits Python’s async ecosystem and Jupyter notebooks.
What forge3d does and how it’s built
At its core, forge3d is a cross-platform 3D renderer implemented in Rust, leveraging the wgpu graphics API — a modern, safe wrapper over Vulkan, Metal, DX12, and WebGPU for native and headless GPU rendering. The choice of wgpu means forge3d avoids OpenGL and Vulkan installation hassles, running headless or with a native window across platforms.
The project targets terrain and scene rendering, supporting GeoTIFF/DEM files for elevation data, LAZ/COPC/EPT point cloud formats for large-scale 3D scans, and COG for streaming geospatial data. This makes it suitable for geospatial visualization, mapping, and scientific applications.
Performance-critical GPU rendering logic is written in Rust for safety and speed, while the user-facing API is Python-first. This is achieved by shipping forge3d as pre-compiled Rust binaries exposed via Python wheels using FFI (Foreign Function Interface). This pattern sidesteps the typical pain of compiling Rust GPU code on client machines, improving developer and user experience.
Architecturally, forge3d separates the GPU rendering backend (TerrainRenderer, Scene) from the interactive viewer session (Session). The viewer API is asynchronous and uses Python context managers to manage viewer lifecycle with open_viewer_async. This design cleanly isolates interactive viewing from offscreen rendering, making it flexible for notebooks, scripts, and batch jobs.
The project uses an open-core licensing model: the core is dual-licensed under Apache-2.0 and MIT, while pro features like SVG/PDF export, MapPlate composition, and building import pipelines require a commercial license key. This is a pragmatic tradeoff that funds continued development while keeping the core open source.
What sets forge3d apart technically
The standout technical aspect is how forge3d ships a Rust-based GPU renderer under the hood as pre-built Python wheels. This solves a common pain point in Rust GPU projects where users must compile complex GPU code and manage native dependencies.
Using the wgpu backend, forge3d achieves cross-platform GPU acceleration on Windows, macOS, and Linux, including headless environments without a window system. This is a big plus for automation and server-side rendering.
The async viewer API is thoughtfully designed. open_viewer_async is a Python async context manager that launches a viewer session, exposing methods to control camera, lighting, and snapshots asynchronously. This fits naturally with Python’s async/await syntax and integrates well with notebook widgets when installed.
The codebase maintains a clear separation between the rendering engine (TerrainRenderer, Scene) and the interactive viewer (Session). This distinction provides flexibility: you can run headless offscreen renders or interactive sessions with GUI or notebook widgets.
While the core rendering code is performance-focused Rust, the Python API prioritizes usability and developer experience. The pre-compiled wheels reduce installation friction, and optional extras provide notebook widget support and sample datasets.
The open-core model introduces a tradeoff: some advanced features require a commercial license, which might limit adoption for fully open source projects but funds sustainable maintenance.
Quick start with forge3d
Installing forge3d is straightforward with pip and supports optional extras for Jupyter notebook widgets and datasets:
pip install forge3d
Optional extras:
pip install "forge3d[jupyter]" # notebook widget support
pip install "forge3d[datasets]" # on-demand sample datasets
pip install "forge3d[all]" # everything
Using the async viewer API looks like this:
import forge3d as f3d
dem_path = f3d.fetch_dem("rainier")
with f3d.open_viewer_async(terrain_path=dem_path, width=1440, height=900) as viewer:
viewer.set_z_scale(0.1)
viewer.set_orbit_camera(phi_deg=28, theta_deg=49, radius=5400, fov_deg=42)
viewer.set_sun(azimuth_deg=302, elevation_deg=24)
viewer.snapshot("rainier.png", width=1920, height=1080)
This snippet fetches a sample terrain dataset, opens an async viewer session, configures camera and lighting, and takes a snapshot. The async context manager ensures proper resource cleanup.
Verdict
forge3d is a solid example of shipping a Rust GPU-heavy renderer to Python users with minimal friction. The combination of wgpu for cross-platform GPU rendering and Rust-Python FFI wheels makes it accessible without sacrificing performance.
The async viewer API is clean and fits well with modern Python async patterns and notebook integrations, improving developer experience.
The open-core licensing model is a realistic tradeoff that supports sustainability but limits some pro features behind a paywall.
forge3d is relevant for developers building terrain visualization, geospatial mapping, or large-scale point cloud rendering pipelines who want a performant, Python-friendly renderer without diving into Rust or GPU driver complexities.
Limitations include the commercial license requirement for advanced features, and potential GPU backend constraints with wgpu depending on platform support.
Overall, forge3d is worth exploring if you need a robust Rust-based 3D rendering engine exposed cleanly to Python, especially with async viewer capabilities and multi-format geospatial data support.
→ GitHub Repo: milos-agathon/forge3d ⭐ 266 · Rust