Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ConductiveInterfaceInfo.h
Go to the documentation of this file.
1#pragma once
2
6
7#include <Common/primitive_type.h>
8
9#include <memory>
10#include <optional>
11
12namespace ph
13{
14
15class ConductorFresnel;
16
23{
24public:
26 explicit ConductiveInterfaceInfo(const math::Spectrum& f0);
27
29 real iorOuter,
30 const math::Spectrum& iorInnerN,
31 const math::Spectrum& iorInnerK);
32
33 std::unique_ptr<ConductorFresnel> genFresnelEffect() const;
34
35 void setFresnel(EInterfaceFresnel fresnel);
36 void setF0(const math::Spectrum& f0);
37 void setIorOuter(real iorOuter);
38 void setIorInnerN(const math::Spectrum& iorInnerN);
39 void setIorInnerK(const math::Spectrum& iorInnerK);
40
41private:
42 EInterfaceFresnel m_fresnel;
43 math::Spectrum m_f0;
44 real m_iorOuter;
45 std::optional<math::Spectrum> m_iorInnerN;
46 std::optional<math::Spectrum> m_iorInnerK;
47
48public:
50 {
51 StructType ztruct("conductive-interface");
52 ztruct.description("Data describing the effects when light hits an conductive interface.");
53
54 TSdlEnumField<OwnerType, EInterfaceFresnel> fresnel("fresnel", &OwnerType::m_fresnel);
55 fresnel.description("Type of the Fresnel for the conductive interface.");
56 fresnel.optional();
58 ztruct.addField(fresnel);
59
60 TSdlSpectrum<OwnerType> f0("f0", math::EColorUsage::Raw, &OwnerType::m_f0);
61 f0.description(
62 "Surface reflectance on normal incidence. This value is expected to be given in linear-sRGB "
63 "space. When this parameter is used, the underlying Fresnel model will be an approximated "
64 "one (schlick) which is pretty popular in real-time graphics. Also note that F0 already "
65 "includes the information of ior-outer.");
66 f0.optional();
68 ztruct.addField(f0);
69
70 TSdlReal<OwnerType> iorOuter("ior-outer", &OwnerType::m_iorOuter);
71 iorOuter.description("The index of refraction outside of this interface.");
72 iorOuter.defaultTo(1.0_r);
73 iorOuter.optional();
74 ztruct.addField(iorOuter);
75
76 TSdlOptionalSpectrum<OwnerType> iorInnerN("ior-inner-n", math::EColorUsage::Raw, &OwnerType::m_iorInnerN);
77 iorInnerN.description("The complex index of refraction (real part) inside of this interface.");
78 ztruct.addField(iorInnerN);
79
80 TSdlOptionalSpectrum<OwnerType> iorInnerK("ior-inner-k", math::EColorUsage::Raw, &OwnerType::m_iorInnerK);
81 iorInnerK.description("The complex index of refraction (imaginary part) inside of this interface.");
82 ztruct.addField(iorInnerK);
83
84 return ztruct;
85 }
86};
87
88}// end namespace ph
Data describing the effects when light hits an conductive interface.
Definition ConductiveInterfaceInfo.h:23
PH_DEFINE_SDL_STRUCT(TSdlOwnerStruct< ConductiveInterfaceInfo >)
Definition ConductiveInterfaceInfo.h:49
void setIorInnerK(const math::Spectrum &iorInnerK)
Definition ConductiveInterfaceInfo.cpp:98
std::unique_ptr< ConductorFresnel > genFresnelEffect() const
Definition ConductiveInterfaceInfo.cpp:36
void setIorOuter(real iorOuter)
Definition ConductiveInterfaceInfo.cpp:88
void setIorInnerN(const math::Spectrum &iorInnerN)
Definition ConductiveInterfaceInfo.cpp:93
void setF0(const math::Spectrum &f0)
Definition ConductiveInterfaceInfo.cpp:83
ConductiveInterfaceInfo()
Definition ConductiveInterfaceInfo.cpp:12
void setFresnel(EInterfaceFresnel fresnel)
Definition ConductiveInterfaceInfo.cpp:78
Definition TSdlEnumField.h:23
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
EInterfaceFresnel
Definition sdl_component_enums.h:10