Module gpuFlux

Class SpectralSun

All Implemented Interfaces:
Transformation, Pickable, Renderable, Manageable, PersistenceCapable, Shareable, UserFields, XObject, Map, Serializable

public class SpectralSun extends Sun
A Sun node with a user-defined spectral power distribution (SPD).

The SPD is applied by wrapping the internal DirectionalLight in a SpectralLight before it is installed. The powerDensity field inherited from Sun continues to control the total irradiance [W m⁻²]; the SPD shape is given by the supplied SpectralCurve.

The default SPD is a blackbody at 5778 K, which is the standard physical approximation of the solar photosphere spectrum.

Usage example in RGG:

   SpectralSun sun = new SpectralSun(52f, 170, 12, 0, 15f, 1500f);
   // default is already blackbody 5778 K; override if needed:
   sun.setSpectrum(new BlackbodySpectralCurve(6000f));
 

Author:
MH at YNL 2026
See Also:
  • Field Details

  • Constructor Details

    • SpectralSun

      public SpectralSun()
      Creates a spectral sun node with default parameters (blackbody 5778 K SPD).
    • SpectralSun

      public SpectralSun(float latitude, int dayOfYear, int hourOfDay, int minuteOfHour, float distance, float powerDensity)
      Parameters:
      latitude - geographic latitude [degrees]
      dayOfYear - day of year [1..365]
      hourOfDay - hour [0..23]
      minuteOfHour - minute [0..59]
      distance - distance of light node from origin [m]
      powerDensity - irradiance [W m⁻²]
  • Method Details

    • wrapLight

      protected Light wrapLight(DirectionalLight dl)
      Description copied from class: Sun
      Hook for subclasses to wrap the DirectionalLight before it is installed via LightNode.setLight(de.grogra.imp3d.shading.Light). The default returns dl unchanged; override in e.g. SpectralSun (GPUFlux module) to return a SpectralLight with a custom SPD.
      Overrides:
      wrapLight in class Sun
    • setSpectrum

      public void setSpectrum(SpectralCurve curve)
      sets the spectral distribution
      Parameters:
      curve - is the spectral distribution
    • setSpectrum

      public void setSpectrum(SPDIF spd)
      sets the spectral distribution
      Parameters:
      curve - is the spectral distribution
    • getNTypeImpl

      protected Node.NType getNTypeImpl()
      Description copied from class: Node
      This method returns the Node.NType which describes the managed fields of the class of this node. This method has to be implemented in every concrete subclass.
      Overrides:
      getNTypeImpl in class Sun
      Returns:
      type describing the managed fields of the class of this node
    • newInstance

      protected Node newInstance()
      Description copied from class: Node
      This method returns a new instance of the class of this node. This method has to be implemented in every concrete subclass.
      Overrides:
      newInstance in class Sun
      Returns:
      new instance of class of this node
    • getSpectrum

      public SpectralLightMap getSpectrum()
    • setSpectrum

      public void setSpectrum(SpectralLightMap value)