00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef TOXIC_RENDERER_PERFECTSPECULARBRDF_H
00024 #define TOXIC_RENDERER_PERFECTSPECULARBRDF_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 PerfectSpecularBRDF : public IBRDF {
00038 public:
00039
00040
00041
00042 virtual ~PerfectSpecularBRDF() {}
00043
00044 virtual PerfectSpecularBRDF *Clone() const;
00045
00046 virtual bool IsDiffuse() const { return false; }
00047 virtual bool IsSpecular() const { return true; }
00048
00049
00050
00051 virtual sheep::Real Evaluate(
00052 const Context &context,
00053 const sheep::Vector3 &incoming,
00054 const sheep::Vector3 &outgoing) const;
00055
00056 virtual sheep::Real EvaluateSpecular(
00057 const Context &context,
00058 const sheep::Vector3 &incoming,
00059 sheep::Vector3 *outgoing) const;
00060
00061
00062
00063
00064
00065 virtual void Sample(
00066 const Context &context,
00067 const sheep::Vector3 &incoming,
00068 sheep::Vector3 *outgoing,
00069 sheep::Real *prob,
00070 sheep::Real *value) const;
00071
00072
00073
00074
00075 virtual sheep::Real ComputeScatteringProbability(
00076 const sheep::Vector3 &incoming,
00077 const sheep::Vector3 &outgoing) const;
00078
00079
00080 virtual sheep::Real ComputeReflectance(const Context &context) const;
00081
00082
00083
00084 virtual sheep::Real ComputeReflectance(
00085 const Context &context,
00086 const sheep::Vector3 &incoming) const;
00087 };
00088
00089 #include "perfectspecularbrdf.inl"
00090
00091 }
00092
00093 #endif // !TOXIC_RENDERER_PERFECTSPECULARBRDF_H