A real-time sky and aerial-perspective rendering prototype built with Pilot Light.
Based on Sébastien Hillaire's A Scalable and Production Ready Sky and Atmosphere Rendering Technique .
This is an experimental implementation of a physically based planetary atmosphere renderer.
The project follows the general approach described by Sébastien Hillaire in A Scalable and Production Ready Sky and Atmosphere Rendering Technique. It uses several compact GPU-generated lookup tables to render a dynamic sky and aerial perspective without relying on a large precomputed multidimensional scattering table.
This repository is intended to serve as:
- A readable reference implementation of the technique.
- A testing ground for atmospheric rendering features.
- A standalone example of low-level graphics programming with Pilot Light.
- A prototype from which stable features can later be integrated into the main Pilot Light renderer.
Important
This is a research and development prototype, not a production-ready atmosphere system. APIs, shaders, parameters, and rendering behavior may change as the implementation is refined.
Screenshots and video captures will be added as the prototype is prepared for release.
The current implementation includes:
- Physically based Rayleigh and Mie scattering.
- Atmospheric absorption.
- Dynamic sun direction and lighting.
- Transmittance lookup table.
- Multiple-scattering lookup table.
- Sky-view lookup table.
- Aerial-perspective 3D lookup table.
- Depth-aware aerial-perspective compositing.
- Configurable atmosphere and planet parameters.
- Runtime regeneration of atmosphere lookup tables.
- Directional-light shadowing within the aerial-perspective pass.
- Support for rendering atmospheric light shafts and volumetric shadows.
- Ground-level and high-altitude camera views.
- Interactive debugging and parameter adjustment.
The implementation is written as a graphics prototype rather than a direct line-by-line port of the paper's reference code.
The atmosphere is rendered in several stages.
The transmittance lookup table stores the amount of sunlight that remains after traveling through the atmosphere.
It is primarily parameterized by:
- Observer altitude.
- Direction relative to the planet.
- Atmospheric extinction.
This table is reused by the later sky and scattering passes.
The multiple-scattering lookup table approximates light that scatters through the atmosphere more than once.
This is important near the horizon and during sunrise or sunset, where single-scattering-only implementations can appear unnaturally dark or strongly yellow.
The sky-view lookup table stores the atmosphere's incoming radiance for the current camera position and sun direction.
The table uses a nonlinear parameterization that allocates additional detail near the horizon, where atmospheric gradients are most visible.
A 3D lookup table stores the accumulated in-scattered light and transmittance between the camera and points at increasing distances.
The volume is sampled using the scene depth buffer to apply atmosphere to rendered geometry.
The final passes combine:
- Scene color.
- Scene depth.
- Sky radiance.
- Aerial-perspective scattering.
- Atmospheric transmittance.
- Sun and shadow information.
The resulting image is then passed through the application's normal exposure and tone-mapping pipeline.
The prototype exposes atmosphere and rendering settings through its development UI.
Available or planned controls include:
- Planet radius.
- Atmosphere height.
- Rayleigh scattering coefficients.
- Rayleigh density distribution.
- Mie scattering and absorption coefficients.
- Mie anisotropy.
- Absorption-layer parameters.
- Sun direction.
- Sun illuminance or radiance multiplier.
- Atmosphere density scale.
- Aerial-perspective distance.
- Aerial-perspective depth distribution.
- LUT dimensions.
- Ray-marching sample counts.
- Volumetric shadowing.
- Debug visualization of individual lookup tables.
Some parameters are intentionally more permissive than physically measured Earth values so the prototype can also be used to explore fictional atmospheres.
The project uses Pilot Light and its platform and graphics abstractions.
General requirements:
- Git
- A C/C++ compiler supported by your platform
- The platform requirements described in the Pilot Light building guide
- Visual Studio 2019 or newer toolchain
- Desktop development with C++
- Vulkan SDK
- GCC or Clang
- Vulkan SDK
- X11 and XCB development packages
- Xcode command-line tools
- Vulkan SDK for shader compilation and related development tools
This repository is structured as a standalone Pilot Light project. A separate Pilot Light checkout is not required after cloning this repository.
git clone https://github.com/hoffstadt/pl-sky
cd pl-sky
cd src
build_win32.batgit clone https://github.com/hoffstadt/pl-sky
cd pl-sky
cd src
chmod +x build_macos.sh
./build_macos.shgit clone https://github.com/hoffstadt/pl-sky
cd pl-sky
cd src
chmod +x build_linux.sh
./build_linux.shBinaries will be in the out directory.

