Module gpuFlux

Class SpectralShaderPresets

java.lang.Object
de.grogra.gpuflux.imp3d.shading.SpectralShaderPresets

public final class SpectralShaderPresets extends Object
Factory class for physically-calibrated spectral shader presets.

Each factory method creates a Phong, GGX, or Ward instance with all channels replaced by ChannelSPD objects backed by IrregularSpectralCurve data over the PAR range 400–700 nm (10 nm steps, 31 sample points). Non-spectral fields (roughness, shininess, etc.) are set by delegating to the corresponding RGB preset first.

Usage:

   GGX  leafUpper = SpectralShaderPresets.ggx(ShaderPreset.LEAF_ADAXIAL);
   Ward brushed   = SpectralShaderPresets.ward(ShaderPreset.BRUSHED_METAL);
   Phong glass    = SpectralShaderPresets.phong(ShaderPreset.GLASS);
 

Data sources

  • Leaf reflectance/transmittance: Woolley (1971); Jacquemoud & Baret (1990) PROSPECT model; LOPEX93 database (Hosgood et al. 1995).
  • Soil: Baumgardner et al. (1985) spectral reflectance of soil types.
  • Metal (aluminium): Palik & Ghosh (1985) optical constants.
  • Glass / greenhouse glass: measured transmission curves for standard float glass and horticultural iron-rich glass.
  • Plastic film (LDPE): representative manufacturer data.
Author:
MH at YNL 2026
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final float[]
    Unpolished aluminium greenhouse frame reflectance.
    static final float[]
    Concrete reflectance — medium gray, nearly flat spectrum.
    static final float[]
    High-albedo flat reference (≈95% across PAR; Lambertian reference white).
    static final float[]
    Diffuser panel: 46% flat reflectance component.
    static final float[]
    Diffuser panel: 46% flat transmittance component.
    static final float[]
    Diffusing opal plastic — ~30% diffuse reflectance (flat).
    static final float[]
    Diffusing opal plastic — ~30% diffuse transmittance (flat).
    static final float[]
    Standard float glass transmittance.
    static final float[]
    Horticultural greenhouse glass transmittance.
    static final float[]
    Green broadleaf — abaxial (lower) side reflectance.
    static final float[]
    Abaxial transmittance (same as adaxial — mesophyll is symmetric for T).
    static final float[]
    Green broadleaf — adaxial (upper) side reflectance.
    static final float[]
    Green broadleaf transmittance (both sides similar).
    static final float[]
    Barley (Hordeum vulgare) adaxial leaf reflectance — bluish-green, waxy.
    static final float[]
    Barley leaf transmittance.
    static final float[]
    Cotton (Gossypium hirsutum) adaxial leaf reflectance — light green, large.
    static final float[]
    Cotton leaf transmittance.
    static final float[]
    Dry / senescent leaf reflectance.
    static final float[]
    Dry leaf transmittance (strongly reduced due to loss of chloroplast structure).
    static final float[]
    Juvenile leaf reflectance — very light green, strong chlorophyll absorption.
    static final float[]
    Juvenile leaf transmittance — high water content, strong absorption.
    static final float[]
    Maize (Zea mays) adaxial leaf reflectance — C4, deep green, waxy.
    static final float[]
    Maize leaf transmittance.
    static final float[]
    Rice (Oryza sativa) adaxial leaf reflectance — slightly higher green peak than broadleaf.
    static final float[]
    Rice leaf transmittance.
    static final float[]
    Senescent leaf reflectance — between mature and fully dry, yellow-green.
    static final float[]
    Senescent leaf transmittance — reduced but not fully suppressed.
    static final float[]
    Wheat (Triticum aestivum) adaxial leaf reflectance — yellow-green.
    static final float[]
    Near-perfect aluminium mirror reflectance.
    static final float[]
    LDPE plastic film transmittance (typical horticultural greenhouse film).
    static final float[]
    Polished / brushed aluminium reflectance (slightly lower than mirror due to surface oxidation; both polished and brushed share this spectral shape — anisotropy in Ward is purely geometric, not spectral).
    static final float[]
    Retroreflector approximation: 90% flat (best-effort Lambertian).
    static final float[]
    Quartz sand reflectance — yellowish-beige, monotonic rise.
    static final float[]
    Dry sandy-loam soil reflectance.
    static final float[]
    Wet sandy-loam soil reflectance.
    static final float[]
    Wavelength sampling points [nm] shared by all spectra below.
    static final float[]
    White plastic / foil reflector — high albedo, nearly flat.
  • Method Summary

    Modifier and Type
    Method
    Description
    static GGX
    ggx(ShaderPreset preset)
    Creates a spectrally calibrated GGX shader for the given preset.
    static Phong
    Creates a spectrally calibrated Phong shader for the given preset.
    static Ward
    Creates a spectrally calibrated Ward shader for the given preset.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • WAVELENGTHS

      public static final float[] WAVELENGTHS
      Wavelength sampling points [nm] shared by all spectra below.
    • LEAF_ADAXIAL_REFL

      public static final float[] LEAF_ADAXIAL_REFL
      Green broadleaf — adaxial (upper) side reflectance. Shows blue/red chlorophyll absorption bands and a green peak near 550 nm. Source: Woolley (1971); LOPEX93 average.
    • LEAF_ADAXIAL_TRANS

      public static final float[] LEAF_ADAXIAL_TRANS
      Green broadleaf transmittance (both sides similar). Source: Woolley (1971); LOPEX93 average.
    • LEAF_ABAXIAL_REFL

      public static final float[] LEAF_ABAXIAL_REFL
      Green broadleaf — abaxial (lower) side reflectance. Slightly higher than adaxial due to spongy mesophyll scattering.
    • LEAF_ABAXIAL_TRANS

      public static final float[] LEAF_ABAXIAL_TRANS
      Abaxial transmittance (same as adaxial — mesophyll is symmetric for T).
    • LEAF_DRY_REFL

      public static final float[] LEAF_DRY_REFL
      Dry / senescent leaf reflectance. Chlorophyll degraded: blue/red absorption bands flatten, overall reflectance rises, colour shifts toward yellow-brown.
    • LEAF_DRY_TRANS

      public static final float[] LEAF_DRY_TRANS
      Dry leaf transmittance (strongly reduced due to loss of chloroplast structure).
    • SOIL_DRY_REFL

      public static final float[] SOIL_DRY_REFL
      Dry sandy-loam soil reflectance. Characteristic monotonic increase from blue to red.
    • SOIL_WET_REFL

      public static final float[] SOIL_WET_REFL
      Wet sandy-loam soil reflectance. Water darkens the soil by filling pore air spaces (~50% of dry values).
    • MIRROR_REFL

      public static final float[] MIRROR_REFL
      Near-perfect aluminium mirror reflectance. Slightly rising toward longer wavelengths (slight dip below 450 nm).
    • POLISHED_METAL_REFL

      public static final float[] POLISHED_METAL_REFL
      Polished / brushed aluminium reflectance (slightly lower than mirror due to surface oxidation; both polished and brushed share this spectral shape — anisotropy in Ward is purely geometric, not spectral).
    • GLASS_TRANS

      public static final float[] GLASS_TRANS
      Standard float glass transmittance. High transmission (86–89%) across PAR, decreasing slightly toward UV.
    • GREENHOUSE_GLASS_TRANS

      public static final float[] GREENHOUSE_GLASS_TRANS
      Horticultural greenhouse glass transmittance. Iron content causes selective absorption in blue/green, reducing overall transmission to ~78–85% across PAR.
    • PLASTIC_FILM_TRANS

      public static final float[] PLASTIC_FILM_TRANS
      LDPE plastic film transmittance (typical horticultural greenhouse film). Very flat spectrum, slightly higher transmission than glass (~84–88%).
    • DIFFUSE_REFL

      public static final float[] DIFFUSE_REFL
      High-albedo flat reference (≈95% across PAR; Lambertian reference white).
    • DIFFUSER_REFL

      public static final float[] DIFFUSER_REFL
      Diffuser panel: 46% flat reflectance component.
    • DIFFUSER_TRANS

      public static final float[] DIFFUSER_TRANS
      Diffuser panel: 46% flat transmittance component.
    • RETROREFLECTOR_REFL

      public static final float[] RETROREFLECTOR_REFL
      Retroreflector approximation: 90% flat (best-effort Lambertian).
    • SAND_REFL

      public static final float[] SAND_REFL
      Quartz sand reflectance — yellowish-beige, monotonic rise.
    • CONCRETE_REFL

      public static final float[] CONCRETE_REFL
      Concrete reflectance — medium gray, nearly flat spectrum.
    • WHITE_PLASTIC_REFL

      public static final float[] WHITE_PLASTIC_REFL
      White plastic / foil reflector — high albedo, nearly flat.
    • ALUMINIUM_GREENHOUSE_REFL

      public static final float[] ALUMINIUM_GREENHOUSE_REFL
      Unpolished aluminium greenhouse frame reflectance.
    • DIFFUSING_PLASTIC_REFL

      public static final float[] DIFFUSING_PLASTIC_REFL
      Diffusing opal plastic — ~30% diffuse reflectance (flat).
    • DIFFUSING_PLASTIC_TRANS

      public static final float[] DIFFUSING_PLASTIC_TRANS
      Diffusing opal plastic — ~30% diffuse transmittance (flat).
    • LEAF_RICE_REFL

      public static final float[] LEAF_RICE_REFL
      Rice (Oryza sativa) adaxial leaf reflectance — slightly higher green peak than broadleaf.
    • LEAF_RICE_TRANS

      public static final float[] LEAF_RICE_TRANS
      Rice leaf transmittance.
    • LEAF_BARLEY_REFL

      public static final float[] LEAF_BARLEY_REFL
      Barley (Hordeum vulgare) adaxial leaf reflectance — bluish-green, waxy.
    • LEAF_BARLEY_TRANS

      public static final float[] LEAF_BARLEY_TRANS
      Barley leaf transmittance.
    • LEAF_WHEAT_REFL

      public static final float[] LEAF_WHEAT_REFL
      Wheat (Triticum aestivum) adaxial leaf reflectance — yellow-green.
    • LEAF_COTTON_REFL

      public static final float[] LEAF_COTTON_REFL
      Cotton (Gossypium hirsutum) adaxial leaf reflectance — light green, large.
    • LEAF_COTTON_TRANS

      public static final float[] LEAF_COTTON_TRANS
      Cotton leaf transmittance.
    • LEAF_MAIZE_REFL

      public static final float[] LEAF_MAIZE_REFL
      Maize (Zea mays) adaxial leaf reflectance — C4, deep green, waxy.
    • LEAF_MAIZE_TRANS

      public static final float[] LEAF_MAIZE_TRANS
      Maize leaf transmittance.
    • LEAF_JUVENILE_REFL

      public static final float[] LEAF_JUVENILE_REFL
      Juvenile leaf reflectance — very light green, strong chlorophyll absorption.
    • LEAF_JUVENILE_TRANS

      public static final float[] LEAF_JUVENILE_TRANS
      Juvenile leaf transmittance — high water content, strong absorption.
    • LEAF_SENESCENT_REFL

      public static final float[] LEAF_SENESCENT_REFL
      Senescent leaf reflectance — between mature and fully dry, yellow-green.
    • LEAF_SENESCENT_TRANS

      public static final float[] LEAF_SENESCENT_TRANS
      Senescent leaf transmittance — reduced but not fully suppressed.
  • Method Details

    • ggx

      public static GGX ggx(ShaderPreset preset)
      Creates a spectrally calibrated GGX shader for the given preset.
      Parameters:
      preset - the desired material preset
      Returns:
      a new GGX instance with spectral ChannelSPD diffuse/transparency channels
    • ward

      public static Ward ward(ShaderPreset preset)
      Creates a spectrally calibrated Ward shader for the given preset.
      Parameters:
      preset - the desired material preset
      Returns:
      a new Ward instance with spectral ChannelSPD diffuse/transparency channels
    • phong

      public static Phong phong(ShaderPreset preset)
      Creates a spectrally calibrated Phong shader for the given preset.
      Parameters:
      preset - the desired material preset
      Returns:
      a new Phong instance with spectral ChannelSPD diffuse/transparency channels