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
5#include "Actor/Image/Image.h"
6#include "SDL/sdl_interface.h"
7
8#include <memory>
9
10namespace ph
11{
12
14{
15public:
16 void genSurface(const CookingContext& ctx, SurfaceBehavior& behavior) const override;
17
18private:
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
25public:
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
Information about the world being cooked.
Definition CookingContext.h:24
Data describing the effects when light hits an dielectric interface.
Definition DielectricInterfaceInfo.h:22
Definition SurfaceBehavior.h:15
Definition SurfaceMaterial.h:15
SDL binding type for a canonical SDL resource class.
Definition TSdlOwnerClass.h:23
A value that points to a SDL resource.
Definition TSdlReference.h:21
TSdlReference & optional()
Definition TSdlReference.ipp:214
TSdlReference & description(std::string descriptionStr)
Definition TSdlReference.ipp:206
Definition ThinDielectricSurface.h:14
void genSurface(const CookingContext &ctx, SurfaceBehavior &behavior) const override
Definition ThinDielectricSurface.cpp:14
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< ThinDielectricSurface >)
Definition ThinDielectricSurface.h:26
The root for all renderer implementations.
Definition EEngineProject.h:6