Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
DielectricInterfaceInfo.h
Go to the documentation of this file.
1#pragma once
2
4#include "SDL/sdl_interface.h"
5
6#include <Common/primitive_type.h>
7
8#include <memory>
9#include <variant>
10
11namespace ph
12{
13
14class DielectricFresnel;
15
22{
23public:
25
27 EInterfaceFresnel fresnel,
28 real iorOuter,
29 real iorInner);
30
31 std::unique_ptr<DielectricFresnel> genFresnelEffect() const;
32
33 void setFresnel(EInterfaceFresnel fresnel);
34 void setIorOuter(real iorOuter);
35 void setIorInner(real iorInner);
36
37private:
38 EInterfaceFresnel m_fresnel;
39 real m_iorOuter;
40 real m_iorInner;
41
42public:
44 {
45 StructType ztruct("dielectric-interface");
46 ztruct.description("Data describing the effects when light hits an dielectric interface.");
47
48 TSdlEnumField<OwnerType, EInterfaceFresnel> fresnel("fresnel", &OwnerType::m_fresnel);
49 fresnel.description("Type of the Fresnel for the dielectric interface.");
50 fresnel.optional();
52 ztruct.addField(fresnel);
53
54 TSdlReal<OwnerType> iorOuter("ior-outer", &OwnerType::m_iorOuter);
55 iorOuter.description("The index of refraction outside of this interface.");
56 iorOuter.optional();
57 iorOuter.defaultTo(1);
58 ztruct.addField(iorOuter);
59
60 TSdlReal<OwnerType> iorInner("ior-inner", &OwnerType::m_iorInner);
61 iorInner.description("The index of refraction inside of this interface.");
62 iorInner.niceToHave();
63 iorInner.defaultTo(1.5_r);
64 ztruct.addField(iorInner);
65
66 return ztruct;
67 }
68};
69
70}// end namespace ph
Data describing the effects when light hits an dielectric interface.
Definition DielectricInterfaceInfo.h:22
std::unique_ptr< DielectricFresnel > genFresnelEffect() const
Definition DielectricInterfaceInfo.cpp:26
void setIorInner(real iorInner)
Definition DielectricInterfaceInfo.cpp:54
void setFresnel(EInterfaceFresnel fresnel)
Definition DielectricInterfaceInfo.cpp:44
DielectricInterfaceInfo()
Definition DielectricInterfaceInfo.cpp:12
void setIorOuter(real iorOuter)
Definition DielectricInterfaceInfo.cpp:49
PH_DEFINE_SDL_STRUCT(TSdlOwnerStruct< DielectricInterfaceInfo >)
Definition DielectricInterfaceInfo.h:43
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
TSdlValue & description(std::string descriptionStr)
Definition TSdlValue.ipp:95
TSdlValue & optional()
Definition TSdlValue.ipp:103
TSdlValue & defaultTo(T defaultValue)
Definition TSdlValue.ipp:71
TSdlValue & niceToHave()
Definition TSdlValue.ipp:110
The root for all renderer implementations.
Definition EEngineProject.h:6
EInterfaceFresnel
Definition sdl_component_enums.h:10