Photon Engine
2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ThinDielectricSurface.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
Actor/Material/SurfaceMaterial.h
"
4
#include "
Actor/Material/Component/DielectricInterfaceInfo.h
"
5
#include "
Actor/Image/Image.h
"
6
#include "
SDL/sdl_interface.h
"
7
8
#include <memory>
9
10
namespace
ph
11
{
12
13
class
ThinDielectricSurface
:
public
SurfaceMaterial
14
{
15
public
:
16
void
genSurface
(
const
CookingContext
& ctx,
SurfaceBehavior
& behavior)
const override
;
17
18
private
:
19
DielectricInterfaceInfo
m_interfaceInfo;
20
std::shared_ptr<Image> m_thickness;
21
std::shared_ptr<Image> m_sigmaT;
22
std::shared_ptr<Image> m_reflectionScale;
23
std::shared_ptr<Image> m_transmissionScale;
24
25
public
:
26
PH_DEFINE_SDL_CLASS
(
TSdlOwnerClass<ThinDielectricSurface>
)
27
{
28
ClassType clazz(
"thin-dielectric-surface"
);
29
clazz.description(
30
"Treating a single interface as a solid material with a near-negligible thickness."
);
31
clazz.docName(
"Thin Surface Material"
);
32
clazz.baseOn<
SurfaceMaterial
>();
33
34
clazz.addStruct(&OwnerType::m_interfaceInfo);
35
36
TSdlReference<Image, OwnerType>
thickness(
"thickness"
, &OwnerType::m_thickness);
37
thickness.
description
(
38
"Thickness in standard scene unit. If not provided, the surface will be treated as if "
39
"there is no volumetric scattering within the material."
);
40
thickness.
optional
();
41
clazz.addField(thickness);
42
43
TSdlReference<Image, OwnerType>
sigmaT(
"sigma-t"
, &OwnerType::m_sigmaT);
44
sigmaT.
description
(
45
"The volume attenuation coefficient. This parameter does not have any effect if thickness "
46
"is not provided."
);
47
sigmaT.
optional
();
48
clazz.addField(sigmaT);
49
50
TSdlReference<Image, OwnerType>
reflectionScale(
"reflection-scale"
, &OwnerType::m_reflectionScale);
51
reflectionScale.
description
(
52
"A scaling factor for energy reflected by the interface. Note that this property is only "
53
"for artistic control and is not physically correct."
);
54
reflectionScale.
optional
();
55
clazz.addField(reflectionScale);
56
57
TSdlReference<Image, OwnerType>
transmissionScale(
"transmission-scale"
, &OwnerType::m_transmissionScale);
58
transmissionScale.
description
(
59
"A scaling factor for energy transmitted by the interface. Note that this property is only "
60
"for artistic control and is not physically correct."
);
61
transmissionScale.
optional
();
62
clazz.addField(transmissionScale);
63
64
return
clazz;
65
}
66
};
67
68
}
// end namespace ph
DielectricInterfaceInfo.h
Image.h
SurfaceMaterial.h
ph::CookingContext
Information about the world being cooked.
Definition
CookingContext.h:24
ph::DielectricInterfaceInfo
Data describing the effects when light hits an dielectric interface.
Definition
DielectricInterfaceInfo.h:22
ph::SurfaceBehavior
Definition
SurfaceBehavior.h:15
ph::SurfaceMaterial
Definition
SurfaceMaterial.h:15
ph::TSdlOwnerClass
SDL binding type for a canonical SDL resource class.
Definition
TSdlOwnerClass.h:23
ph::TSdlReference
A value that points to a SDL resource.
Definition
TSdlReference.h:21
ph::TSdlReference::optional
TSdlReference & optional()
Definition
TSdlReference.ipp:214
ph::TSdlReference::description
TSdlReference & description(std::string descriptionStr)
Definition
TSdlReference.ipp:206
ph::ThinDielectricSurface
Definition
ThinDielectricSurface.h:14
ph::ThinDielectricSurface::genSurface
void genSurface(const CookingContext &ctx, SurfaceBehavior &behavior) const override
Definition
ThinDielectricSurface.cpp:14
ph::ThinDielectricSurface::PH_DEFINE_SDL_CLASS
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< ThinDielectricSurface >)
Definition
ThinDielectricSurface.h:26
ph
The root for all renderer implementations.
Definition
EEngineProject.h:6
sdl_interface.h
Source
Actor
Material
ThinDielectricSurface.h
Generated by
1.11.0