Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ViewPathTracingPolicy.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <Common/assertion.h>
6
7namespace ph
8{
9
13{
16
19};
20
24{
25public:
27
31
35
40
46
47 bool isKilled() const;
48 bool useRussianRoulette() const;
52
53private:
54 bool m_isKilled;
55 bool m_useRussianRoulette;
56 EViewPathSampleMode m_sampleMode;
57 SurfaceElemental m_targetElemental;
58 SurfacePhenomena m_targetPhenomena;
59};
60
61// In-header Implementations:
62
64 m_isKilled(false),
65 m_useRussianRoulette(true),
66 m_sampleMode(EViewPathSampleMode::SinglePath),
67 m_targetElemental(ALL_SURFACE_ELEMENTALS),
68 m_targetPhenomena()
69{}
70
72{
73 m_isKilled = true;
74
75 return *this;
76}
77
79{
80 m_useRussianRoulette = useRR;
81
82 return *this;
83}
84
86{
88 m_targetElemental = elemental;
89
90 return *this;
91}
92
94{
96 m_targetPhenomena = phenomena;
97
98 return *this;
99}
100
102{
103 return m_useRussianRoulette;
104}
105
107{
108 return m_sampleMode;
109}
110
112{
113 PH_ASSERT(m_sampleMode == EViewPathSampleMode::SinglePath);
114
115 return m_targetElemental;
116}
117
119{
120 PH_ASSERT(m_sampleMode == EViewPathSampleMode::ElementalBranch);
121
122 return m_targetPhenomena;
123}
124
126{
127 return m_isKilled;
128}
129
130}// end namespace ph
Manipulate a value type where each bit is a binary flag.
Definition TBitFlags.h:17
Specifying and querying policies for tracing view path.
Definition ViewPathTracingPolicy.h:24
SurfacePhenomena getTargetPhenomena() const
Definition ViewPathTracingPolicy.h:118
ViewPathTracingPolicy()
Definition ViewPathTracingPolicy.h:63
ViewPathTracingPolicy & kill()
Kills the path.
Definition ViewPathTracingPolicy.h:71
SurfaceElemental getTargetElemental() const
Definition ViewPathTracingPolicy.h:111
ViewPathTracingPolicy & traceBranchedPathFor(SurfacePhenomena phenomena)
Effectively as specifying EViewPathSampleMode::ElementalBranch.
Definition ViewPathTracingPolicy.h:93
bool useRussianRoulette() const
Definition ViewPathTracingPolicy.h:101
bool isKilled() const
Definition ViewPathTracingPolicy.h:125
ViewPathTracingPolicy & traceSinglePathFor(SurfaceElemental elemental)
Effectively as specifying EViewPathSampleMode::SinglePath.
Definition ViewPathTracingPolicy.h:85
EViewPathSampleMode getSampleMode() const
Definition ViewPathTracingPolicy.h:106
The root for all renderer implementations.
Definition EEngineProject.h:6
EViewPathSampleMode
Directives on how to trace the next path.
Definition ViewPathTracingPolicy.h:13
int SurfaceElemental
Definition surface_optics_fwd.h:30
constexpr SurfaceElemental ALL_SURFACE_ELEMENTALS
Definition surface_optics_fwd.h:58