Point Light

template<IsSpectral TSpectral>
class SphereLight : public huira::Light<TSpectral>

Public Functions

SphereLight(const units::Meter &radius, const units::SpectralWatts<TSpectral> &spectral_power)

Constructs a SphereLight from spectral power.

Parameters:
  • radius – The radius of the sphere in meters.

  • spectral_power – Total spectral power emitted over the entire surface.

SphereLight(const units::Meter &radius, const units::SpectralWattsPerMeterSquaredSteradian<TSpectral> &spectral_radiance)

Constructs a SphereLight from spectral radiance.

Parameters:
  • radius – The radius of the sphere in meters.

  • spectral_radiance – Spectral radiance emitted by the surface.

SphereLight(const units::Meter &radius, const units::Watt &power)

Constructs a SphereLight from total scalar power.

Parameters:
  • radius – The radius of the sphere in meters.

  • power – Total power emitted in Watts.

SphereLight(const units::Meter &radius, const units::Kelvin &temperature)

Constructs a blackbody SphereLight from a temperature.

Parameters:
  • radius – The radius of the sphere in meters.

  • power – Temperature in Kelvin.

SphereLight(const SphereLight&) = delete
SphereLight(SphereLight&&) = delete
SphereLight &operator=(const SphereLight&) = delete
SphereLight &operator=(SphereLight&&) = delete
virtual std::optional<LightSample<TSpectral>> sample_li(const Interaction<TSpectral> &isect, const Transform<float> &transform, Sampler<float> &sampler) const override
virtual float pdf_li(const Interaction<TSpectral> &isect, const Transform<float> &transform, const Vec3<float> &wi) const override
inline units::Meter radius() const
virtual TSpectral radiance(const Vec3<float> &point_on_light, const Vec3<float> &outgoing_direction) const override
virtual TSpectral irradiance_at(const Vec3<float> &position, const Transform<float> &light_to_world) const override
inline virtual LightType get_type() const override
inline virtual std::string type() const override

Get the object’s type string.

Returns:

std::string Type

inline virtual std::uint64_t id() const override

Get the object’s unique ID.

Returns:

std::uint64_t ID

inline bool is_scene_owned() const

Check if the object is owned by the scene.

Returns:

bool True if owned

inline void set_scene_owned(bool owned)

Set scene ownership flag.

Parameters:

owned – True if owned

inline std::string name() const

Get the object’s name.

Returns:

std::string Name

inline virtual std::string get_info() const

Get a descriptive info string for the object.

Returns:

std::string Info string

Protected Attributes

std::uint64_t id_ = 0

Protected Static Attributes

static std::uint64_t next_id_ = 0