Beispiel #1
0
// DiffuseAreaLight Method Definitions
DiffuseAreaLight::DiffuseAreaLight(const Transform &LightToWorld,
                                   const MediumInterface &mediumInterface,
                                   const Spectrum &Lemit, int nSamples,
                                   const std::shared_ptr<Shape> &shape)
    : AreaLight(LightToWorld, mediumInterface, nSamples),
      Lemit(Lemit),
      shape(shape),
      area(shape->Area()) {}
Beispiel #2
0
// DiffuseAreaLight Method Definitions
DiffuseAreaLight::DiffuseAreaLight(const Transform &LightToWorld,
                                   const MediumInterface &mediumInterface,
                                   const Spectrum &Lemit, int nSamples,
                                   const std::shared_ptr<Shape> &shape,
                                   bool twoSided)
    : AreaLight(LightToWorld, mediumInterface, nSamples),
      Lemit(Lemit),
      shape(shape),
      twoSided(twoSided),
      area(shape->Area()) {
    // Warn if light has transformation with non-uniform scale, though not
    // for Triangles, since this doesn't matter for them.
    if (WorldToLight.HasScale() &&
        dynamic_cast<const Triangle *>(shape.get()) == nullptr)
        Warning(
            "Scaling detected in world to light transformation! "
            "The system has numerous assumptions, implicit and explicit, "
            "that this transform will have no scale factors in it. "
            "Proceed at your own risk; your image may have errors.");
}