#ifndef __GLOBALLINESRENDERER_H #define __GLOBALLINESRENDERER_H #include "common.h" #include "Containers.h" #include "Vector3.h" class RenderTexture; namespace GtpVisibilityPreprocessor { class Beam; class Intersectable; class Preprocessor; class GlRenderer; struct VssRayContainer; class GlobalLinesRenderer { public: /*GlobalLinesRenderer(RenderTexture *buffer1, RenderTexture *buffer2, Preprocessor *preprocessor, GlRenderer *renderer); */ GlobalLinesRenderer(Preprocessor *preprocessor, GlRenderer *renderer); ~GlobalLinesRenderer(); void CastGlobalLines(Beam &beam, const int samples); void InitGl(); /** Computes rays from information gained with hw sampling */ void ComputeRays(Intersectable *sourceObj, VssRayContainer &rays); float GetPixelError(int &pvsSize); int ComputePvs(ObjectContainer &objects, ObjectContainer &pvs) const; void RenderObject(Intersectable *obj); /** Draws the geometry for one pass. */ void DrawGeometry(); void Run(); void GrabDepthBuffer(float *data, RenderTexture *rt); void GrabItemBuffer(float *data, RenderTexture *rt); void ApplyDepthPeeling(Beam &beam, const int samples); void ExportDepthBuffer(); void ProcessDepthBuffer(VssRayContainer &vssRays); int mMaxDepth; Vector3 mEyeVec; Vector3 mLeftVec; Vector3 mUpVec; float mFar; float mNear; float *mNewDepthBuffer; float *mOldDepthBuffer; float *mNewItemBuffer; float *mOldItemBuffer; RenderTexture *mNewTexture; RenderTexture *mOldTexture; protected: void ProcessDepthBuffer(); void SwitchRenderTextures(); void SetupProjection(const Vector3 &viewPoint, const Beam &beam); Preprocessor *mPreprocessor; GlRenderer *mRenderer; }; extern GlobalLinesRenderer *globalLinesRenderer; }; #endif