[1941] | 1 | #ifndef __GLOBALLINESRENDERER_H
|
---|
| 2 | #define __GLOBALLINESRENDERER_H
|
---|
| 3 |
|
---|
| 4 | #include "common.h"
|
---|
| 5 | #include "Containers.h"
|
---|
| 6 |
|
---|
| 7 | class RenderTexture;
|
---|
| 8 |
|
---|
| 9 | namespace GtpVisibilityPreprocessor {
|
---|
| 10 |
|
---|
| 11 | class Beam;
|
---|
| 12 | class Intersectable;
|
---|
| 13 | class Preprocessor;
|
---|
| 14 | class GlRenderer;
|
---|
| 15 |
|
---|
| 16 | struct VssRayContainer;
|
---|
| 17 |
|
---|
| 18 | class GlobalLinesRenderer
|
---|
| 19 | {
|
---|
| 20 | public:
|
---|
| 21 | /*GlobalLinesRenderer(RenderTexture *buffer1,
|
---|
| 22 | RenderTexture *buffer2,
|
---|
| 23 | Preprocessor *preprocessor,
|
---|
| 24 | GlRenderer *renderer);
|
---|
| 25 | */
|
---|
| 26 | GlobalLinesRenderer(Preprocessor *preprocessor, GlRenderer *renderer);
|
---|
| 27 |
|
---|
| 28 | ~GlobalLinesRenderer();
|
---|
| 29 |
|
---|
| 30 | void CastGlobalLines(Beam &beam, const int samples);
|
---|
| 31 |
|
---|
| 32 | void InitGl();
|
---|
| 33 |
|
---|
| 34 | /** Computes rays from information gained with hw sampling
|
---|
| 35 | */
|
---|
| 36 | void ComputeRays(Intersectable *sourceObj, VssRayContainer &rays);
|
---|
| 37 |
|
---|
| 38 | float GetPixelError(int &pvsSize);
|
---|
| 39 |
|
---|
| 40 | int ComputePvs(ObjectContainer &objects, ObjectContainer &pvs) const;
|
---|
| 41 |
|
---|
| 42 | void RenderObject(Intersectable *obj);
|
---|
| 43 | void DrawGeometry();
|
---|
| 44 | void Run();
|
---|
| 45 | protected:
|
---|
| 46 |
|
---|
| 47 | void ProcessDepthBuffer();
|
---|
| 48 |
|
---|
| 49 | /** Draws the geometry for one pass.
|
---|
| 50 | */
|
---|
| 51 |
|
---|
| 52 |
|
---|
| 53 | void ApplyDepthPeeling(Beam &beam, const int samples);
|
---|
| 54 |
|
---|
| 55 | void SwitchRenderTextures();
|
---|
| 56 |
|
---|
| 57 | void SetupProjection(const Vector3 &viewPoint,
|
---|
| 58 | const Beam &beam);
|
---|
| 59 |
|
---|
| 60 | RenderTexture *mNewBuffer;
|
---|
| 61 | RenderTexture *mOldBuffer;
|
---|
| 62 |
|
---|
| 63 | Preprocessor *mPreprocessor;
|
---|
| 64 | int mMaxDepth;
|
---|
| 65 |
|
---|
| 66 | GlRenderer *mRenderer;
|
---|
| 67 | };
|
---|
| 68 |
|
---|
| 69 | extern GlobalLinesRenderer *globalLinesRenderer;
|
---|
| 70 |
|
---|
| 71 | };
|
---|
| 72 |
|
---|
| 73 | #endif
|
---|
| 74 |
|
---|