Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
SurfaceLayerInfo.h
Go to the documentation of this file.
1#pragma once
2
4#include "Math/TVector3.h"
6#include "SDL/sdl_interface.h"
8
9#include <Common/primitive_type.h>
10
11namespace ph
12{
13
15{
16public:
17 real getRoughness() const;
18 real getAlpha() const;
19 math::Spectrum getIorN() const;
20 math::Spectrum getIorK() const;
21 real getDepth() const;
22 real getG() const;
25
26private:
27 real m_roughness;
28 math::Spectrum m_iorN;
29 math::Spectrum m_iorK;
30 real m_depth;
31 real m_g;
32 math::Spectrum m_sigmaA;
33 math::Spectrum m_sigmaS;
34
35public:
37 {
38 StructType ztruct("surface-layer-info");
39 ztruct.description("Data for layered material construction.");
40
41 TSdlReal<OwnerType> roughness("roughness", &OwnerType::m_roughness);
42 roughness.description("Roughness of the layer.");
43 roughness.defaultTo(0);
44 roughness.optional();
45 ztruct.addField(roughness);
46
47 TSdlSpectrum<OwnerType> iorN("ior-n", math::EColorUsage::Raw, &OwnerType::m_iorN);
48 iorN.description("The real part of the layer's index of refraction.");
50 iorN.optional();
51 ztruct.addField(iorN);
52
53 TSdlSpectrum<OwnerType> iorK("ior-k", math::EColorUsage::Raw, &OwnerType::m_iorK);
54 iorK.description("The imaginary part of the layer's index of refraction.");
56 iorK.optional();
57 ztruct.addField(iorK);
58
59 TSdlReal<OwnerType> depth("depth", &OwnerType::m_depth);
60 depth.description("Thickness of the layer.");
61 depth.defaultTo(0);
62 depth.optional();
63 ztruct.addField(depth);
64
65 TSdlReal<OwnerType> g("g", &OwnerType::m_g);
66 g.description("The g variable in Henyey-Greenstein phase function.");
67 g.defaultTo(1);
68 g.optional();
69 ztruct.addField(g);
70
71 TSdlSpectrum<OwnerType> sigmaA("sigma-a", math::EColorUsage::Raw, &OwnerType::m_sigmaA);
72 sigmaA.description("The volume absorption coefficient.");
73 sigmaA.defaultTo(math::Spectrum(0));
74 sigmaA.optional();
75 ztruct.addField(sigmaA);
76
77 TSdlSpectrum<OwnerType> sigmaS("sigma-s", math::EColorUsage::Raw, &OwnerType::m_sigmaS);
78 sigmaS.description("The volume scattering coefficient.");
79 sigmaS.defaultTo(math::Spectrum(0));
80 sigmaS.optional();
81 ztruct.addField(sigmaS);
82
83 return ztruct;
84 }
85};
86
87// In-header Implementations:
88
90{
91 return m_roughness;
92}
93
98
100{
101 return m_iorN;
102}
103
105{
106 return m_iorK;
107}
108
109inline real SurfaceLayerInfo::getDepth() const
110{
111 return m_depth;
112}
113
114inline real SurfaceLayerInfo::getG() const
115{
116 return m_g;
117}
118
120{
121 return m_sigmaA;
122}
123
125{
126 return m_sigmaS;
127}
128
129}// end namespace ph
static real squared(const real roughness)
Mapping for a perceptually linear roughness.
Definition RoughnessToAlphaMapping.h:55
Definition SurfaceLayerInfo.h:15
real getRoughness() const
Definition SurfaceLayerInfo.h:89
math::Spectrum getIorK() const
Definition SurfaceLayerInfo.h:104
math::Spectrum getSigmaA() const
Definition SurfaceLayerInfo.h:119
math::Spectrum getSigmaS() const
Definition SurfaceLayerInfo.h:124
real getG() const
Definition SurfaceLayerInfo.h:114
real getAlpha() const
Definition SurfaceLayerInfo.h:94
real getDepth() const
Definition SurfaceLayerInfo.h:109
math::Spectrum getIorN() const
Definition SurfaceLayerInfo.h:99
PH_DEFINE_SDL_STRUCT(TSdlOwnerStruct< SurfaceLayerInfo >)
Definition SurfaceLayerInfo.h:36
SDL binding type for a typical C++ struct.
Definition TSdlOwnerStruct.h:18
A field class that binds a floating point member variable.
Definition TSdlReal.h:21
Definition TSdlSpectrum.h:27
TSdlValue & description(std::string descriptionStr)
Definition TSdlValue.ipp:95
TSdlValue & optional()
Definition TSdlValue.ipp:103
TSdlValue & defaultTo(T defaultValue)
Definition TSdlValue.ipp:71
Definition TTristimulusSpectrum.h:11
The root for all renderer implementations.
Definition EEngineProject.h:6