Class SkyModelLibrary

java.lang.Object
de.grogra.skymodellibrary.SkyModelLibrary

public final class SkyModelLibrary extends Object
Named constants and factory methods for the predefined sky model presets in the SkyModelLibrary plugin.

Sky models in GroIMP fall into two families:

Environment shaders (Sky + analytic shader)

The Sky node wraps a shader implementing computeExitance / computeBSDF. In Twilight (Sunflow raytracer) the sky radiance function is sampled continuously per ray. In GPUFlux it is pre-baked at scene-build time to a 512×512 importance-sampled environment map and serialized to the GPU. Both renderers give physically correct illumination. The background sky colour is visible in rendered images. Sun direction is set as a manual direction vector.

Models: PREETHAM, HOSEK_WILKIE, PRAGUE

Discrete light arrays

The sky is approximated as a fixed set of directional lights (72–73, Turtle geometry). Works in any renderer. Solar position is computed from geographic coordinates (latitude, day-of-year, hour) via the Goudriaan algorithm. Irradiance is driven by real-world DHI/DNI measurements or CIE sky types. No background image is produced.

Models: OVERCAST, PEREZ, CIE

Usage in XL/RGG scripts:

 Sky sky = SkyModelLibrary.createPreetham();
 Sky hw  = SkyModelLibrary.createHosekWilkie();
 CIELighting cie = SkyModelLibrary.createCIE();
 
Author:
MH at YNL 2026
  • Field Details

    • PREETHAM

      public static final String PREETHAM
      Preetham (1999) analytic sky model — turbidity parameter.
      See Also:
    • HOSEK_WILKIE

      public static final String HOSEK_WILKIE
      Hosek-Wilkie (2012) analytic sky model — turbidity + ground albedo.
      See Also:
    • PRAGUE

      public static final String PRAGUE
      Prague Sky Model (2021) — dataset-driven, full spectral. Requires external dataset.
      See Also:
    • OVERCAST

      public static final String OVERCAST
      Isotropic overcast sky — 72 Turtle-geometry directional lights.
      See Also:
    • PEREZ

      public static final String PEREZ
      Perez all-weather sky — 73 lights, DHI/DNI driven.
      See Also:
    • CIE

      public static final String CIE
      CIE Standard General Sky types 1–15 (CIE S 110:2003).
      See Also:
    • ENV_SHADER_NAMES

      public static final String[] ENV_SHADER_NAMES
      All environment-shader model names, in display order.
    • DISCRETE_LIGHT_NAMES

      public static final String[] DISCRETE_LIGHT_NAMES
      All discrete-light model names, in display order.
    • ALL_NAMES

      public static final String[] ALL_NAMES
      All model names combined, environment shaders first.
  • Method Details

    • createPreetham

      public static Sky createPreetham()
      Creates a Sky node with a default Preetham (1999) shader. Turbidity is set to 3 (moderately clear).
    • createHosekWilkie

      public static Sky createHosekWilkie()
      Creates a Sky node with a default HosekWilkieSkyLight (2012) shader. Turbidity 3, ground albedo 0.1.
    • createPrague

      public static Sky createPrague()
      Creates a Sky node with a PragueSkyModelLight stub. Set the dataset path via ((PragueSkyModelLight) sky.getShader()).setDatasetPath(path).
    • createOvercast

      public static SkyDome createOvercast()
      Creates a default SkyDome (isotropic overcast, 300 W/m²).
    • createPerez

      public static PerezSunSky createPerez()
      Creates a default PerezSunSky (Perez all-weather sky).
    • createCIE

      public static CIELighting createCIE()
      Creates a default CIELighting (CIE Standard Sky type 7 — partly cloudy).