Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
InterfaceStatistics.h
Go to the documentation of this file.
1#pragma once
2
8
9#include <Common/assertion.h>
10#include <Common/primitive_type.h>
11
12namespace ph
13{
14
16{
17public:
18 InterfaceStatistics(real cosWi, const LbLayer& layer1);
19
20 bool addLayer(const LbLayer& layer2);
21
22 real getEquivalentAlpha() const;
23 const math::Spectrum& getEnergyScale() const;
24 LbLayer getLastLayer() const;
25
26private:
27 real m_equivalentAlpha;
28 math::Spectrum m_energyScale;
29
30 LbLayer m_layer0, m_layer1;
31
32 real m_cosWi;
33 math::Spectrum m_R0i, m_Ri0, m_T0i, m_Ti0;
34 real m_sR0i, m_sRi0, m_sT0i, m_sTi0;
35 real m_J0i, m_Ji0;
36
37 static const TableFGD& FGD();
38 static const TableTIR& TIR();
39};
40
41// In-header Implementations:
42
43inline InterfaceStatistics::InterfaceStatistics(const real cosWi, const LbLayer& layer1) :
44
45 m_equivalentAlpha(0.0_r),
46 m_energyScale(1.0_r),
47
48 m_layer0(layer1), m_layer1(layer1),
49
50 m_cosWi(cosWi),
51 m_R0i (0), m_Ri0 (0), m_T0i (1), m_Ti0 (1),
52 m_sR0i(0), m_sRi0(0), m_sT0i(0), m_sTi0(0),
53 m_J0i (1), m_Ji0 (1)
54{
55 PH_ASSERT(0.0_r <= m_cosWi && m_cosWi <= 1.0_r);
56
57 // DEBUG
58 const TableFGD& fgd = FGD();
59 const TableTIR& tir = TIR();
60}
61
63{
64 return m_equivalentAlpha;
65}
66
68{
69 return m_energyScale;
70}
71
73{
74 return m_layer1;
75}
76
77inline const TableFGD& InterfaceStatistics::FGD()
78{
79 static const TableFGD table(CoreResource("LaurentBelcourBsdf/table_FGD.bin").getPath());
80 return table;
81}
82
83inline const TableTIR& InterfaceStatistics::TIR()
84{
85 static const TableTIR table(CoreResource("LaurentBelcourBsdf/table_TIR.bin").getPath());
86 return table;
87}
88
89}// end namespace ph
Definition CoreResource.h:11
Definition InterfaceStatistics.h:16
const math::Spectrum & getEnergyScale() const
Definition InterfaceStatistics.h:67
InterfaceStatistics(real cosWi, const LbLayer &layer1)
Definition InterfaceStatistics.h:43
real getEquivalentAlpha() const
Definition InterfaceStatistics.h:62
LbLayer getLastLayer() const
Definition InterfaceStatistics.h:72
bool addLayer(const LbLayer &layer2)
Definition InterfaceStatistics.cpp:9
Definition LbLayer.h:11
Definition TableFGD.h:19
Definition TableTIR.h:18
Definition TTristimulusSpectrum.h:11
The root for all renderer implementations.
Definition EEngineProject.h:6