#ifndef _SamplingPreprocessor_H__ #define _SamplingPreprocessor_H__ #include using namespace std; #include "Preprocessor.h" struct SimpleRay { Vector3 mOrigin; Vector3 mDirection; }; /** Sampling based visibility preprocessing. The implementation is based on heuristical sampling of view space */ class SamplingPreprocessor : public Preprocessor { public: int mPass; int mSamplesPerPass; int mTotalSamples; int mKdPvsDepth; ofstream mStats; ObjectContainer mObjects; SamplingPreprocessor(); virtual bool ComputeVisibility(); void SetupRay(Ray &ray, const Vector3 &point, const Vector3 &direction); KdNode * GetNodeForPvs(KdLeaf *leaf); int AddNodeSamples(Intersectable *object, const Ray &ray); void HoleSamplingPass(); int CastRay(Intersectable *object, Ray &ray); void CastEdgeSamples( Intersectable *object, const Vector3 &point, Mesh &mesh, const int samples ); }; #endif