source: GTP/trunk/Lib/Vis/Preprocessing/src/GlobalLinesRenderer.h @ 1953

Revision 1953, 1.8 KB checked in by mattausch, 17 years ago (diff)

worked on hw global lines

Line 
1#ifndef __GLOBALLINESRENDERER_H
2#define __GLOBALLINESRENDERER_H
3
4#include "common.h"
5#include "Containers.h"
6#include "Vector3.h"
7
8
9class RenderTexture;
10
11namespace GtpVisibilityPreprocessor {
12
13class Beam;
14class Intersectable;
15class Preprocessor;
16class GlRenderer;
17
18struct VssRayContainer;
19
20class GlobalLinesRenderer
21{
22public:
23        /*GlobalLinesRenderer(RenderTexture *buffer1,
24                                                RenderTexture *buffer2,
25                                                Preprocessor *preprocessor,
26                                                GlRenderer *renderer);
27*/
28        GlobalLinesRenderer(Preprocessor *preprocessor, GlRenderer *renderer);
29
30        ~GlobalLinesRenderer();
31
32        void CastGlobalLines(Beam &beam, const int samples);
33
34        void InitGl();
35
36        /** Computes rays from information gained with hw sampling
37        */
38        void ComputeRays(Intersectable *sourceObj, VssRayContainer &rays);
39
40        float GetPixelError(int &pvsSize);
41
42        int ComputePvs(ObjectContainer &objects, ObjectContainer &pvs) const;
43
44        void RenderObject(Intersectable *obj);
45
46       
47        /** Draws the geometry for one pass.
48        */
49        void DrawGeometry();
50void Run();
51void GrabDepthBuffer(float *data, RenderTexture *rt);
52void GrabItemBuffer(float *data, RenderTexture *rt);
53void ApplyDepthPeeling(Beam &beam, const int samples);
54void ExportDepthBuffer();
55void ProcessDepthBuffer(VssRayContainer &vssRays);
56
57        int mMaxDepth;
58        Vector3 mEyeVec;
59        Vector3 mLeftVec;
60        Vector3 mUpVec;
61        float mFar;
62        float mNear;
63
64        float *mNewDepthBuffer;
65        float *mOldDepthBuffer;
66        float *mNewItemBuffer;
67        float *mOldItemBuffer;
68RenderTexture *mNewTexture;
69        RenderTexture *mOldTexture;
70protected:
71
72        void ProcessDepthBuffer();
73
74        void SwitchRenderTextures();
75
76        void SetupProjection(const Vector3 &viewPoint,
77                                                 const Beam &beam);
78
79       
80
81        Preprocessor *mPreprocessor;
82
83        GlRenderer *mRenderer;
84};
85
86extern GlobalLinesRenderer *globalLinesRenderer;
87
88};
89
90#endif
91
Note: See TracBrowser for help on using the repository browser.