Point Cloud Viewer  1.00
A Viewer to display point clouds with phong shading by converting them to splats.
visibilitypass.h
1 #ifndef VISIBILITYPASS_H
2 #define VISIBILITYPASS_H
3 
4 #include "renderpass.h"
5 #include "camera.h"
6 
13 class VisibilityPass: public RenderPass {
14 public:
16  ~VisibilityPass();
17  void render() override;
18  void cleanup() override;
19 
24  void addObjectInput(VaoChannel &vaoChannel);
25 
30  void removeObjectInput(VaoChannel &vaoChannel);
31 
35  void clearObjectInput();
43 
50  bool depthMapToScreen();
51  void removeInput();
52  void updateResolution() override;
53 
61  static void linkVpMat(QMatrix4x4 &vp);
62 
70  static void linkVMat(QMatrix4x4 &v);
71 
80  static void linkPointSizeCoeff(float &coeff);
81 
91  void linkSplatScale(float &scale);
92 private:
93  std::list<VaoChannel*> objectIn;
94  TextureChannel *depthMapOut;
95  GLuint fbo;
96  static GLuint vertexShader, fragmentShader, shaderProgram, loc_mvp, loc_pointSizeCoeff,
97  loc_mv, loc_viewportScale, loc_npdata, loc_depthFactor, loc_splatScale, loc_modelScale;
98  static QMatrix4x4 *vpMat;
99  static QMatrix4x4 *vMat;
100  static float *pointSizeCoeff;
101  static unsigned char instanceCounter;
102  float *splatScale;
103  bool initialized;
104 
105  bool generateFBO();
106  void removeFBO();
107  bool init();
108  static bool initShaders();
109  static void cleanupShaders();
110 };
111 
112 #endif // VISIBILITYPASS_H
void removeObjectInput(VaoChannel &vaoChannel)
Removes a model from the geometry input list.
Definition: visibilitypass.cpp:39
static void linkVpMat(QMatrix4x4 &vp)
Links the view projection matrix that shall be used during rendering.
Definition: visibilitypass.cpp:74
An abstract class for Render Passes.
Definition: renderpass.h:26
void addObjectInput(VaoChannel &vaoChannel)
Adds a model to the geometry input list.
Definition: visibilitypass.cpp:35
This channel is used to link textures or data maps.
Definition: renderpass.h:210
void cleanup() override
Resets the Render Pass to the state after creation but before initialization.
Definition: visibilitypass.cpp:27
void clearObjectInput()
Removes all models from the geometry input list.
Definition: visibilitypass.cpp:43
A Render Pass that just fills a depth buffer.
Definition: visibilitypass.h:13
static void linkVMat(QMatrix4x4 &v)
Links the view matrix that shall be used during rendering.
Definition: visibilitypass.cpp:78
void linkSplatScale(float &scale)
Links the splat scale.
Definition: visibilitypass.cpp:86
bool depthMapToScreen()
Changes the output mode. The depth map is now drawn onto the screen.
Definition: visibilitypass.cpp:53
TextureChannel & getDepthMapOutput()
Returns the depth buffer.
Definition: visibilitypass.cpp:47
void render() override
Uses the input data to generate the output.
Definition: visibilitypass.cpp:193
void updateResolution() override
Must be called after the screen resolution has changed.
Definition: visibilitypass.cpp:62
static void linkPointSizeCoeff(float &coeff)
Links the point size coefficient.
Definition: visibilitypass.cpp:82
void removeInput()
Removes all input channels except for VaoChannels. If the Render Pass uses VaoChannels as input use t...
Definition: visibilitypass.cpp:60