Line | |
---|
1 | #ifndef _SamplingPreprocessor_H__ |
---|
2 | #define _SamplingPreprocessor_H__ |
---|
3 | |
---|
4 | #include <fstream> |
---|
5 | using namespace std; |
---|
6 | |
---|
7 | #include "Preprocessor.h" |
---|
8 | |
---|
9 | struct SimpleRay { |
---|
10 | Vector3 mOrigin; |
---|
11 | Vector3 mDirection; |
---|
12 | }; |
---|
13 | |
---|
14 | /** Sampling based visibility preprocessing. The implementation is based on heuristical |
---|
15 | sampling of view space */ |
---|
16 | class SamplingPreprocessor : public Preprocessor { |
---|
17 | public: |
---|
18 | int mSamplesPerPass; |
---|
19 | int mTotalSamples; |
---|
20 | int mKdPvsDepth; |
---|
21 | ofstream mStats; |
---|
22 | ObjectContainer mObjects; |
---|
23 | |
---|
24 | SamplingPreprocessor(); |
---|
25 | |
---|
26 | virtual bool ComputeVisibility(); |
---|
27 | |
---|
28 | void |
---|
29 | SetupRay(Ray &ray, const Vector3 &point, const Vector3 &direction); |
---|
30 | |
---|
31 | KdNode * |
---|
32 | GetNodeForPvs(KdLeaf *leaf); |
---|
33 | |
---|
34 | int |
---|
35 | AddNodeSamples(Intersectable *object, const Ray &ray, const int pass); |
---|
36 | |
---|
37 | void |
---|
38 | HoleSamplingPass(); |
---|
39 | |
---|
40 | }; |
---|
41 | |
---|
42 | |
---|
43 | |
---|
44 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.