Point Cloud Viewer  1.00
A Viewer to display point clouds with phong shading by converting them to splats.
lightpass.h
1 #ifndef LIGHTPASS_H
2 #define LIGHTPASS_H
3 
4 #include "renderpass.h"
5 
12 class LightPass: public RenderPass {
13 public:
14  LightPass();
15  ~LightPass();
16  void render() override;
17  void cleanup() override;
18 
23  void addObjectInput(VaoChannel &vaoChannel);
24 
29  void removeObjectInput(VaoChannel &vaoChannel);
30 
34  void clearObjectInput();
35 
42  void setDepthMapInput(TextureChannel &textureChannel);
43 
51 
58  bool imageToScreen();
59  void removeInput();
60  void updateResolution() override;
61 
69  static void linkVpMat(QMatrix4x4 &vp);
70 private:
71  std::list<VaoChannel*> objectIn;
72  TextureChannel *depthMapIn, *imageOut;
73  GLuint fbo;
74  static GLuint vertexShader, fragmentShader, shaderProgram, loc_mvp, loc_depthMap, loc_resolution;
75  static QMatrix4x4 *vpMat;
76  static unsigned char instanceCounter;
77  float *splatScale;
78  bool initialized;
79 
80  bool generateFBO();
81  void removeFBO();
82  bool init();
83  static bool initShaders();
84  static void cleanupShaders();
85 };
86 
87 #endif // LIGHTPASS_H
static void linkVpMat(QMatrix4x4 &vp)
Links the view projection matrix that shall be used during rendering.
Definition: lightpass.cpp:78
void clearObjectInput()
Removes all light models from the geometry input list.
Definition: lightpass.cpp:40
void setDepthMapInput(TextureChannel &textureChannel)
Sets the depth map that shall be used during rendering.
Definition: lightpass.cpp:44
An abstract class for Render Passes.
Definition: renderpass.h:26
This channel is used to link textures or data maps.
Definition: renderpass.h:210
void addObjectInput(VaoChannel &vaoChannel)
Adds a light model to the geometry input list.
Definition: lightpass.cpp:32
bool imageToScreen()
Changes the output mode. The image of the lights is now drawn onto the screen.
Definition: lightpass.cpp:57
void removeObjectInput(VaoChannel &vaoChannel)
Removes a light model from the geometry input list.
Definition: lightpass.cpp:36
void cleanup() override
Resets the Render Pass to the state after creation but before initialization.
Definition: lightpass.cpp:24
void render() override
Uses the input data to generate the output.
Definition: lightpass.cpp:178
A Render Pass that displays yellow squares at the passed locations.
Definition: lightpass.h:12
void updateResolution() override
Must be called after the screen resolution has changed.
Definition: lightpass.cpp:66
void removeInput()
Removes all input channels except for VaoChannels. If the Render Pass uses VaoChannels as input use t...
Definition: lightpass.cpp:64
TextureChannel & getImageOutput()
Returns the image of the lights.
Definition: lightpass.cpp:51