NDEVR
API Documentation
ViewPortSmoothShaderLogic

GPU compute shader that performs viewport-space point smoothing and filtering. More...

Collaboration diagram for ViewPortSmoothShaderLogic:
[legend]

Classes

struct  UBO
 Uniform buffer object layout for the viewport smooth compute shader. More...

Public Member Functions

void buildShader ()
 Compile and link the compute shader program.
void createUBOBuffer ()
 Create the GPU uniform buffer object for shader parameters.
template<class t_point_type>
void getInput (PointContainer< t_point_type > &active, PointContainer< t_point_type > &inactive, uint04 record_weight)
 Read back smoothed points from the GPU, partitioning into active and inactive sets.
void runAll (uint04 count)
 Dispatch the compute shader over the given number of points.
void setQtGL (QOpenGLFunctions_4_3_Core *gl)
 Set the OpenGL function pointer table used by this shader.
void setUBO (const UBO &u)
 Upload uniform buffer data to the GPU.
template<class t_point_type>
void uploadInputs (const PointContainer< t_point_type > &active, uint04 pix_count)
 Upload point cloud data to GPU storage buffers for the smooth pass.

Static Public Member Functions

static void ReadBytes (QOpenGLFunctions_4_3_Core *gl, GLenum target, GLuint buf, void *dst, GLsizeiptr bytes)
 Read bytes from a GPU buffer into CPU memory.

Protected Attributes

Buffer< RGBColorm_colors
 CPU-side color buffer for GPU upload/download.
GLuint m_csA = 0
 Compute shader handle.
uint04 m_last_size = 0
 Number of points in the last upload.
uint04 m_out_size = 0
 Allocated size of the output index buffer.
uint04 m_px_key_size = 0
 Allocated size of the per-pixel key buffer.
QOpenGLShaderProgram * m_shader
 Compiled compute shader program.
GLuint m_ssboInColor = 0
 Input color storage buffer.
GLuint m_ssboInPos = 0
 Input position storage buffer.
GLuint m_ssboInW = 0
 Input weight storage buffer.
GLuint m_ssboOutIdx = 0
 Output index buffer indicating kept points.
GLuint m_ssboPxKey = 0
 Per-pixel key buffer for duplicate detection.
Buffer< uint04m_temp_idx
 CPU-side copy of the output index buffer.
GLuint m_uboU = 0
 Uniform buffer object handle.

Detailed Description

GPU compute shader that performs viewport-space point smoothing and filtering.


Projects existing point cloud data into the current camera viewport, identifies duplicate and overlapping points, and produces a filtered set of active points along with newly-matured inactive points that exceed a recording weight threshold.

Definition at line 15 of file ViewPortSmoothShaderLogic.h.

Member Function Documentation

◆ getInput()

template<class t_point_type>
void ViewPortSmoothShaderLogic::getInput ( PointContainer< t_point_type > & active,
PointContainer< t_point_type > & inactive,
uint04 record_weight )
inline

Read back smoothed points from the GPU, partitioning into active and inactive sets.

Parameters
[in,out]activePoints that remain in the live display.
[in,out]inactivePoints that have matured past the recording weight threshold.
[in]record_weightWeight threshold above which points are moved to inactive.

Definition at line 71 of file ViewPortSmoothShaderLogic.h.

References Buffer< t_type, t_memory_manager >::add(), PointContainer< t_point_type >::data, PointContainer< t_point_type >::locations, m_colors, m_last_size, m_ssboInColor, m_ssboInPos, m_ssboInW, m_ssboOutIdx, m_temp_idx, PointContainer< t_point_type >::setSize(), PointContainer< t_point_type >::size(), and PointContainer< t_point_type >::weights.

◆ ReadBytes()

void ViewPortSmoothShaderLogic::ReadBytes ( QOpenGLFunctions_4_3_Core * gl,
GLenum target,
GLuint buf,
void * dst,
GLsizeiptr bytes )
static

Read bytes from a GPU buffer into CPU memory.

Parameters
[in]glOpenGL function table.
[in]targetBuffer target (e.g. GL_SHADER_STORAGE_BUFFER).
[in]bufGPU buffer handle.
[out]dstDestination CPU memory.
[in]bytesNumber of bytes to read.

◆ runAll()

void ViewPortSmoothShaderLogic::runAll ( uint04 count)

Dispatch the compute shader over the given number of points.

Parameters
[in]countNumber of input points to process.

◆ setQtGL()

void ViewPortSmoothShaderLogic::setQtGL ( QOpenGLFunctions_4_3_Core * gl)

Set the OpenGL function pointer table used by this shader.

Parameters
[in]glPointer to the OpenGL 4.3 core functions.

◆ setUBO()

void ViewPortSmoothShaderLogic::setUBO ( const UBO & u)

Upload uniform buffer data to the GPU.

Parameters
[in]uThe uniform buffer contents to upload.

◆ uploadInputs()

template<class t_point_type>
void ViewPortSmoothShaderLogic::uploadInputs ( const PointContainer< t_point_type > & active,
uint04 pix_count )
inline

Upload point cloud data to GPU storage buffers for the smooth pass.

Parameters
[in]activeThe current active point container to upload.
[in]pix_countTotal number of viewport pixels for the per-pixel key buffer.

Definition at line 110 of file ViewPortSmoothShaderLogic.h.

References PointContainer< t_point_type >::data, PointContainer< t_point_type >::locations, m_colors, m_last_size, m_out_size, m_px_key_size, m_ssboInColor, m_ssboInPos, m_ssboInW, m_ssboOutIdx, m_ssboPxKey, PointContainer< t_point_type >::size(), and PointContainer< t_point_type >::weights.


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