Skip to content

Function: godRaysFromStar()

ts
function godRaysFromStar(cfg): GodRaysParams;

Derives screen-space god rays parameters from a star's physical properties.

  • exposure : driven by luminosity, compensated by visual size (see below)
  • decay : driven by baseline radius (larger type → longer rays)
  • density : driven by baseline radius (larger type → denser step stretch)
  • weight : driven by tempK (hotter star → sharper, more incisive rays)

Visual-size compensation: stars are rendered larger than their SPECTRAL_TABLE reference radius (× ~3 scale), which multiplies the sun's screen footprint and floods the god-rays mask with seed pixels. Exposure is divided by the area ratio (baseRadius / actualRadius)² so the perceived ray intensity matches the baseline calibration regardless of visual scale.

Calibrated on G-type reference (no radius override): exposure≈0.44, decay≈0.94, density≈0.70, weight≈0.36.

Parameters

ParameterType
cfgStarPhysicsInput

Returns

GodRaysParams

Distribué sous la licence indiquée dans le dépôt.