1 | #ifndef _RssPreprocessor_H__
|
---|
2 | #define _RssPreprocessor_H__
|
---|
3 |
|
---|
4 | #include <fstream>
|
---|
5 | using namespace std;
|
---|
6 |
|
---|
7 | #include "Preprocessor.h"
|
---|
8 | #include "VssRay.h"
|
---|
9 |
|
---|
10 | namespace GtpVisibilityPreprocessor {
|
---|
11 |
|
---|
12 |
|
---|
13 | class RssTree;
|
---|
14 | class RssTreeLeaf;
|
---|
15 |
|
---|
16 |
|
---|
17 | /** Sampling based visibility preprocessing. The implementation is
|
---|
18 | based on heuristical sampling of view space
|
---|
19 | */
|
---|
20 | class RssPreprocessor : public Preprocessor {
|
---|
21 |
|
---|
22 | public:
|
---|
23 | vector<SamplingStrategy *> mDistributions;
|
---|
24 | int mSamplesPerPass;
|
---|
25 | int mRssSamplesPerPass;
|
---|
26 | int mInitialSamples;
|
---|
27 | int mRssSamples;
|
---|
28 | bool mUseImportanceSampling;
|
---|
29 |
|
---|
30 | bool mExportPvs;
|
---|
31 | bool mExportRssTree;
|
---|
32 | bool mExportRays;
|
---|
33 | int mExportNumRays;
|
---|
34 |
|
---|
35 | bool mUseViewcells;
|
---|
36 | bool mUpdateSubdivision;
|
---|
37 |
|
---|
38 | bool mObjectBasedSampling;
|
---|
39 | bool mDirectionalSampling;
|
---|
40 |
|
---|
41 | //AxisAlignedBox3 *mViewSpaceBox;
|
---|
42 |
|
---|
43 |
|
---|
44 | RssTree *mRssTree;
|
---|
45 |
|
---|
46 | // rays cast during the processing
|
---|
47 | VssRayContainer mVssRays;
|
---|
48 |
|
---|
49 | /// if initial samples should be loaded from file
|
---|
50 | bool mLoadInitialSamples;
|
---|
51 | /// if initial samples should be stored in file
|
---|
52 | bool mStoreInitialSamples;
|
---|
53 |
|
---|
54 | RssPreprocessor();
|
---|
55 | ~RssPreprocessor();
|
---|
56 |
|
---|
57 | virtual bool ComputeVisibility();
|
---|
58 |
|
---|
59 | #if 0 // matt:: moved up into preprocessor
|
---|
60 | int
|
---|
61 | CastRay(
|
---|
62 | Vector3 &viewPoint,
|
---|
63 | Vector3 &direction,
|
---|
64 | const float probability,
|
---|
65 | VssRayContainer &vssRays
|
---|
66 | );
|
---|
67 | #endif
|
---|
68 | virtual bool BuildBspTree() { return false; }
|
---|
69 |
|
---|
70 |
|
---|
71 | bool
|
---|
72 | ExportRays(const char *filename,
|
---|
73 | const VssRayContainer &vssRays,
|
---|
74 | const int number
|
---|
75 | );
|
---|
76 |
|
---|
77 | bool
|
---|
78 | ExportRayAnimation(const char *filename,
|
---|
79 | const vector<VssRayContainer> &vssRays
|
---|
80 | );
|
---|
81 |
|
---|
82 | void
|
---|
83 | ExportObjectRays(VssRayContainer &rays,
|
---|
84 | const int objectId);
|
---|
85 |
|
---|
86 | int
|
---|
87 | GenerateImportanceRays(RssTree *vssTree,
|
---|
88 | const int desiredSamples,
|
---|
89 | SimpleRayContainer &rays
|
---|
90 | );
|
---|
91 |
|
---|
92 |
|
---|
93 | bool
|
---|
94 | ExportRssTreeLeaf(char *filename,
|
---|
95 | RssTree *tree,
|
---|
96 | RssTreeLeaf *leaf);
|
---|
97 |
|
---|
98 | void
|
---|
99 | ExportRssTreeLeaves(RssTree *tree, const int number);
|
---|
100 |
|
---|
101 |
|
---|
102 | bool
|
---|
103 | ExportRssTree(char *filename,
|
---|
104 | RssTree *tree,
|
---|
105 | const Vector3 &dir
|
---|
106 | );
|
---|
107 |
|
---|
108 |
|
---|
109 | float
|
---|
110 | GetAvgPvsSize(RssTree *tree,
|
---|
111 | const vector<AxisAlignedBox3> &viewcells
|
---|
112 | );
|
---|
113 |
|
---|
114 |
|
---|
115 | void
|
---|
116 | ExportPvs(char *filename,
|
---|
117 | RssTree *rssTree
|
---|
118 | );
|
---|
119 |
|
---|
120 |
|
---|
121 | void
|
---|
122 | ComputeRenderError();
|
---|
123 |
|
---|
124 | /** Redefininition of the get sample rays method from the preprocessor */
|
---|
125 | int
|
---|
126 | GenerateRays(
|
---|
127 | const int number,
|
---|
128 | const int sampleType,
|
---|
129 | SimpleRayContainer &rays
|
---|
130 | );
|
---|
131 |
|
---|
132 | };
|
---|
133 |
|
---|
134 |
|
---|
135 | };
|
---|
136 |
|
---|
137 | #endif
|
---|