NatureGL Skyv1.1.0

Start here

Installation

NatureGL Sky ships as a folder. It has a runnable demo, the library source, and a prebuilt ES module with TypeScript declarations. Pick whichever of the three integration paths suits your build.

#Requirements

three.js>= 0.180 as a peer dependency. Developed and tested on r186
RendererTHREE.WebGLRenderer with WebGL2. The library does not need WebGPU
Node18 or newer, only for the demo and the build scripts
CameraTHREE.PerspectiveCamera. Clouds are reconstructed for one main camera

#Run the demo first

#Unpack and install

bash
cd naturegl-sky
npm install

#Start the dev server

bash
npm run dev

It opens http://localhost:5181/demo/: an island, open sea and a fly camera under the live sky. The demo page lists every control.

#Build or test (optional)

bash
npm run build   # library -> build/, static demo -> dist/
npm test        # headless GPU smoke test of every preset -> test-results/*.png + fps

#What's in the folder

naturegl-sky/
├── src/the library: no DOM UI, no scenery│   ├── SkySystem.jsthe facade: create, update, presets, quality, outputs│   ├── post/SkyPostPass (optional)│   ├── render/cloud march + TAA, bakes, backdrop│   ├── shaders/GLSL as template strings│   ├── materials/cloud-shadow material patch + GLSL snippet│   ├── core/astronomy, CPU atmosphere twin│   └── config/QualityLevels.js, defaults.js, presets/├── build/prebuilt ESM bundle + .d.ts├── demo/the full demo app├── examples/basic/minimal Vite integration├── examples/cdn/plain JS + import map└── scripts/smoke.mjs and dev helpers

#Add it to your project

Copy build/ into your project, for example as lib/naturegl-sky/, and import from it. three stays an external import, so your bundler or an import map resolves it.

js
import { SkySystem } from './lib/naturegl-sky/index.js';

The bundle has a source map and .d.ts files next to it, so editors get types and go-to-definition.

#Without a bundler

An import map resolves three from a CDN. The library comes from your copy of build/.

index.html
<script type="importmap">
  { "imports": { "three": "https://cdn.jsdelivr.net/npm/three@0.186.0/build/three.module.js" } }
</script>
<script type="module">
  import * as THREE from 'three';
  import { SkySystem } from './lib/naturegl-sky/index.js';
</script>

examples/cdn/index.html is a complete page. Serve the package root with any static server, such as npx http-server ., and open /examples/cdn/.

#Next