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