source: trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.h @ 308

Revision 308, 1.1 KB checked in by mattausch, 19 years ago (diff)

bsp tree view cells sampling possible

RevLine 
[162]1#ifndef _SamplingPreprocessor_H__
2#define _SamplingPreprocessor_H__
3
[245]4#include <fstream>
5using namespace std;
6
[162]7#include "Preprocessor.h"
8
[245]9struct SimpleRay {
10  Vector3 mOrigin;
11  Vector3 mDirection;
12};
[162]13
14/** Sampling based visibility preprocessing. The implementation is based on heuristical
15    sampling of view space */
16class SamplingPreprocessor : public Preprocessor {
17public:
[256]18        int mPass;
19
[176]20  int mSamplesPerPass;
21  int mTotalSamples;
22  int mKdPvsDepth;
[245]23  ofstream mStats;
24  ObjectContainer mObjects;
25
[176]26  SamplingPreprocessor();
27
[162]28  virtual bool ComputeVisibility();
[176]29
30  void
31  SetupRay(Ray &ray, const Vector3 &point, const Vector3 &direction);
32
33  KdNode *
34  GetNodeForPvs(KdLeaf *leaf);
35
36  int
[256]37  AddNodeSamples(Intersectable *object, const Ray &ray);
[176]38
[191]39  void
40  HoleSamplingPass();
41
[256]42        int
43        CastRay(Intersectable *object, Ray &ray);
44
45        void
46        CastEdgeSamples(
47                                                                        Intersectable *object,
48                                                                        const Vector3 &point,
49                                                                        Mesh &mesh,
50                                                                        const int samples
51                                                                        );
52
[308]53        /** Adds objects samples to view cells.
54        */
55        int AddObjectSamples(Intersectable *obj, const Ray &ray);
[162]56};
57
58
59
60#endif
Note: See TracBrowser for help on using the repository browser.