/* This file is part of Nori, a simple educational ray tracer Copyright (c) 2015 by Wenzel Jakob Nori is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation. Nori is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #pragma once #include #include NORI_NAMESPACE_BEGIN /** * \brief Superclass of all emitters */ class Emitter : public NoriObject { public: //Sample Emitters without Mesh attached virtual Color3f samplePosition(const Point2f &s, EmitterSample& es) const {return Color3f();}; /** * \brief Sample the Emiter * * \param scene Scene * \param p position * \param lp light position * \param ln light normal * \param pdf_dir direction of the PDF * \param sample A uniformly distributed sample on \f$[0,1]^2\f$ * * \return Color value */ virtual Color3f sample(const Scene *scene, EmitterSample& es) const = 0; /** * \brief Returns the Color evaluated using the light normal and the light to interection path * * \param its light intersection */ virtual Color3f eval(const Intersection &its) const = 0; /** * \brief Returns the PDF using the light normal and the light to interection path * \param lti ray */ virtual float pdf(const Vector3f <i) const = 0; /** * \brief Return the type of object (i.e. Mesh/Emitter/etc.) * provided by this instance * */ EClassType getClassType() const { return EEmitter; } }; NORI_NAMESPACE_END