00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef LUX_SPECULARTRANSMISSION_H
00024 #define LUX_SPECULARTRANSMISSION_H
00025
00026 #include "lux.h"
00027 #include "bxdf.h"
00028 #include "spectrum.h"
00029 #include "fresneldielectric.h"
00030
00031 namespace lux
00032 {
00033
00034 class SpecularTransmission : public BxDF {
00035 public:
00036
00037 SpecularTransmission(const SWCSpectrum &t, float ei, float et, float cbf, bool archi = false)
00038 : BxDF(BxDFType(BSDF_TRANSMISSION | BSDF_SPECULAR)),
00039 T(t), etai(ei), etat(et), cb(cbf), architectural(archi),
00040 fresnel(ei, et) {}
00041 SWCSpectrum f(const Vector &, const Vector &) const;
00042
00043
00044 SWCSpectrum Sample_f(const Vector &wo, Vector *wi, float u1, float u2, float *pdf, float *pdfBack = NULL) const;
00045 float Pdf(const Vector &wo, const Vector &wi) const {
00046 if (architectural && wi == -wo) return 1.f;
00047 else return 0.f;
00048 }
00049 private:
00050
00051 SWCSpectrum T;
00052 float etai, etat, cb;
00053 bool architectural;
00054 FresnelDielectric fresnel;
00055 };
00056
00057 }
00058
00059 #endif // LUX_SPECULARTRANSMISSION_H
00060