31 #ifndef INCLUDE_ARTICULATION_VISIBILITYRENDERER_H_ 32 #define INCLUDE_ARTICULATION_VISIBILITYRENDERER_H_ 34 #include <gpu_coverage/AbstractRenderer.h> 35 #include <gpu_coverage/Programs.h> 38 #undef GET_BUFFER_DIRECT 74 void display(
const bool countPixels);
144 typedef std::list<std::pair<Node *, GLuint> >
Targets;
155 #ifndef GET_BUFFER_DIRECT Definition: Programs.h:390
void getPixelCounts(std::vector< GLuint > &counts)
Returns the list of observed pixels of the previous frames.
const GLuint numPbo
Number of allocated pixel buffer objects.
Definition: VisibilityRenderer.h:158
GLuint pbo[4]
Pixel buffer objects as ring buffer.
Definition: VisibilityRenderer.h:157
Color buffer of the 3D scene, unused.
Definition: VisibilityRenderer.h:149
Texture for reading back pixel counter.
Definition: VisibilityRenderer.h:151
Depth buffer of the 3D scene.
Definition: VisibilityRenderer.h:148
Targets targets
List of targets (regions of interest) with corresponding texture.
Definition: VisibilityRenderer.h:145
virtual void display()
Renders the scene.
const bool renderToWindow
True if renderer should also render to window framebuffer.
Definition: VisibilityRenderer.h:125
~VisibilityRenderer()
Destructor.
void readBack()
Read back ring bufer.
VisibilityRenderer(const Scene *const scene, const bool renderToWindow, const bool countPixels)
Constructor.
GLuint run
Ring buffer index.
Definition: VisibilityRenderer.h:160
GLuint framebuffers[2]
Framebuffers for rendering 3D scene and for rendering visibility texture.
Definition: VisibilityRenderer.h:137
Visibility texture for debugging.
Definition: VisibilityRenderer.h:150
size_t numTextures
Number of allocated teextures.
Definition: VisibilityRenderer.h:139
Scene graph corresponding to Assimp's aiScene.
Definition: Scene.h:59
Scene graph node, corresponding to Assimp's aiNode.
Definition: Node.h:52
const GLuint & getTexture() const
Returns the OpenGL texture ID of the result texture.
Definition: VisibilityRenderer.h:96
ProgramPixelCounter * progPixelCounter
Shadere for counting observed pixels (only if countPixels is true)
Definition: VisibilityRenderer.h:130
AbstractCamera * camera
Camera observing the scene.
Definition: VisibilityRenderer.h:143
Node * projectionPlaneNode
Virtual surface where camera can be placed, only used to hide while rendering.
Definition: VisibilityRenderer.h:142
std::list< GLuint > pixelCounts
List of number of observed pixels in the previous frames, see getPixelCounts()
Definition: VisibilityRenderer.h:135
const Scene *const scene
Pointer to the scene to be rendered.
Definition: AbstractRenderer.h:101
const int textureWidth
Width of the result texture in pixels.
Definition: VisibilityRenderer.h:133
GLuint vaoPoint
Vertex array object for rendering single output pixel.
Definition: VisibilityRenderer.h:161
Definition: Programs.h:363
ProgramVisualFlat progFlat
Shader for 3D rendering without material (used to fill depth buffer)
Definition: VisibilityRenderer.h:127
GLuint curPbo
Current pixel buffer object.
Definition: VisibilityRenderer.h:159
Abstract superclass for all renderers.
Definition: AbstractRenderer.h:45
ProgramVisibility progVisibility
Shader for marking observed texels.
Definition: VisibilityRenderer.h:128
GLuint textures[20]
4 internal textures and up to 16 target textures
Definition: VisibilityRenderer.h:138
const int height
Height of the framebuffer for rendering the 3D scene in pixels.
Definition: VisibilityRenderer.h:132
GLuint vbo
Vertex buffer objeect.
Definition: VisibilityRenderer.h:141
const int textureHeight
Height of the result texture in pixels.
Definition: VisibilityRenderer.h:134
const int width
Width of the framebuffer for rendering the 3D scene in pixels.
Definition: VisibilityRenderer.h:131
Definition: AbstractCamera.h:41
GLuint vboPoint
Vertex buffer object for rendering single output pixel.
Definition: VisibilityRenderer.h:162
Abstract superclass for all cameras.
Definition: AbstractCamera.h:48
TextureRole
Definition: VisibilityRenderer.h:147
const int & getTextureWidth() const
Width of the result texture.
Definition: VisibilityRenderer.h:120
ProgramShowTexture * progShowTexture
Shader for rendering observation texture for debugging (only if renderToWindow is true) ...
Definition: VisibilityRenderer.h:129
const int & getTextureHeight() const
Height of the result texture.
Definition: VisibilityRenderer.h:112
const bool countPixels
True if observed pixels should be counted, can be overwritten by argument to display(const bool count...
Definition: VisibilityRenderer.h:126
std::list< std::pair< Node *, GLuint > > Targets
List of targets (regions of interest) with corresponding texture.
Definition: VisibilityRenderer.h:144
Definition: Programs.h:200
Definition: Programs.h:378
const GLuint & getTexture(const size_t &i) const
Returns the OpenGL texture ID of the result texture in case of multiple textures. ...
Definition: VisibilityRenderer.h:104
Result texture.
Definition: VisibilityRenderer.h:152
GLuint pixelCountBuffer
Atomic counter buffer for reading back pixels counts from GPU.
Definition: VisibilityRenderer.h:136
GLuint vao
Vertex array object.
Definition: VisibilityRenderer.h:140
ProgramCounterToFB * progCounterToFB
Shader counting pixels and writing result directly to framebuffer.
Definition: VisibilityRenderer.h:156
Definition: Programs.h:402
Determines regions visible from a given camera pose and marks the regions as observed on the texture...
Definition: VisibilityRenderer.h:45