// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage


surface
emitter
    [[ string description = "Lambertian emitter material" ]]
(
    float power = 1
        [[  string description = "Total power of the light",
            float UImin = 0 ]],
    color Cs = 1
        [[  string description = "Base color",
            float UImin = 0, float UImax = 1 ]]
  )
{
    // Because emission() returns a radiance that, integrated over all
    // angles, yields a power density of 1, we multiply by the desired
    // total power and divide by the total surface area.  In this
    // manner, the 'power' parameter gives the total power of the light
    // (e.g., in Watts) independently of its physical size or shape
    // (which may be changed to affect shadow softness without altering
    // overall illumination).  N.B.: The total power is BEFORE Cs
    // filters the color!
    Ci = (power / surfacearea()) * Cs * emission();
}
