VisPro  1.0
Project of Visualisierung 2
CutawaySurface Class Reference

#include <CutawaySurface.h>

Public Member Functions

void init (int w, int h, float z_near, float z_far, float angle, float cut)
 
void update (int w, int h, float z_near, float z_far, float angle, float c)
 
void prepareZBufferPass ()
 
void endZBufferPass ()
 
void quadPass (int step, glm::mat4 &vp)
 
void prepareRenderPass (int unit)
 
glm::vec2 getDimension ()
 
GLuint getTextureHandle (int tex)
 
GLuint getFBOHandle (int fbo)
 
void clearBuffers ()
 

Public Attributes

ZBufferShaderz_buffer_shader
 
Quadquad
 
QuadShaderquad_shader
 
float cut
 

Detailed Description

Creation of cutaway surface and usage of resulting frame buffer objects or textures.

Member Function Documentation

void CutawaySurface::clearBuffers ( )

Clear all used frame buffer objects and reset binding.

void CutawaySurface::endZBufferPass ( )

Reset to default frame buffer object and appropriate OpenGL depth test.

vec2 CutawaySurface::getDimension ( )

Dimension of cutaway surface plane in screen coordinates.

Returns
2D vector of cutaway surface plane dimension
GLuint CutawaySurface::getFBOHandle ( int  fbo)

Return frame buffer object handle according to index.

Parameters
fboframe buffer object index
Returns
frame buffer object handle according to index
GLuint CutawaySurface::getTextureHandle ( int  tex)

Return texture handle according to index.

Parameters
textexture index
Returns
texture handle according to index
void CutawaySurface::init ( int  w,
int  h,
float  z_near,
float  z_far,
float  angle,
float  cut 
)

Init two frame buffer objects and attached textures and create z buffer shader and quad shader.

Parameters
wwidth of cutaway surface in screen coordinates
hheight of cutaway surface in screen coordinates
z_neardistance of near plane
z_fardistance of far plane
angledrill angle of cutaway surface cones
cuttrue if intersection with cutaway surfaces should be performed
void CutawaySurface::prepareRenderPass ( int  unit)

Prepare for rendering. Activate texture unit and choose right texture of frame buffer objects which is generated in last quad pass.

Parameters
unittexture unit to activate
void CutawaySurface::prepareZBufferPass ( )

Clear frame buffer object 1 and set appropriate OpenGL depth test.

void CutawaySurface::quadPass ( int  step,
glm::mat4 &  vp 
)

Bind QuadShader to execute one round of jump flooding. Switch between two frame buffer objects back and forth in every pass.

Parameters
stepstep size of current jump flooding iteration
vpcurrent view projection matrix
void CutawaySurface::update ( int  w,
int  h,
float  z_near,
float  z_far,
float  angle,
float  c 
)

Update z buffer shader and quad shader.

Parameters
wwidth of cutaway surface in screen coordinates
hheight of cutaway surface in screen coordinates
z_neardistance of near plane
z_fardistance of far plane
angledrill angle of cutaway surface cones
cuttrue if intersection with cutaway surfaces should be performed

Member Data Documentation

float CutawaySurface::cut

Flag that defines if intersection with cutaway surface should be performed.

Quad* CutawaySurface::quad

Quad used for neighbour coordinate interpolation.

QuadShader* CutawaySurface::quad_shader

Quad shader that implements the jump flood algorithm.

ZBufferShader* CutawaySurface::z_buffer_shader

Z buffer shader used for depth image calculation. Draws backfaces in depth image.


The documentation for this class was generated from the following files: