source: trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.h @ 537

Revision 537, 2.4 KB checked in by bittner, 18 years ago (diff)

ray probability density support

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