00001 /* 00002 toxic - A Global Illumination Renderer 00003 Copyright (C) 2003-2004 Francois Beaune 00004 Contact: http://toxicengine.sourceforge.net/ 00005 00006 This file is part of toxic. 00007 00008 toxic is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 2 of the License, or 00011 (at your option) any later version. 00012 00013 toxic is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with toxic; if not, write to the Free Software 00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 */ 00022 00023 #ifndef TOXIC_RENDERER_LAMBERTIANBRDF_H 00024 #define TOXIC_RENDERER_LAMBERTIANBRDF_H 00025 00026 #include "common/math/real.h" 00027 #include "common/math/vector3.h" 00028 #include "globals.h" 00029 #include "ibdf.h" 00030 00031 #include <cassert> 00032 00033 namespace toxic { 00034 00035 class Context; 00036 00037 class LambertianBRDF : public IBRDF { 00038 public: 00039 //! Incoming and outgoing directions are both always expressed in the upper 00040 //! part of the unit hemisphere, and they are always unit-length. 00041 00042 virtual ~LambertianBRDF() {} 00043 00044 virtual LambertianBRDF *Clone() const; 00045 00046 //! Evaluates the function. Both the incoming and outgoing directions are 00047 //! expressed in local space. 00048 virtual sheep::Real Evaluate( 00049 const Context &context, 00050 const sheep::Vector3 &incoming, 00051 const sheep::Vector3 &outgoing) const; 00052 00053 //! Computes and returns the hemispherical hemispherical reflectance. 00054 virtual sheep::Real ComputeReflectance(const Context &context) const; 00055 00056 //! Computes and returns the directional hemispherical reflectance. The 00057 //! incoming direction is expressed in local space. 00058 virtual sheep::Real ComputeReflectance( 00059 const Context &context, 00060 const sheep::Vector3 &incoming) const; 00061 }; 00062 00063 #include "lambertianbrdf.inl" 00064 00065 } 00066 00067 #endif // !TOXIC_RENDERER_LAMBERTIANBRDF_H
1.3.6