![]() |
NDEVR
API Documentation
|
GPU compute shader that converts depth and color raster frames into 3D colored point positions. More...
Classes | |
| struct | UBO |
| Uniform buffer object layout for the color-position compute shader. More... | |
Public Member Functions | |
| void | buildShader () |
| Compile and link the compute shader program. | |
| void | createImage (const Vector< 2, uint04 > &size) |
| Create the GPU depth image texture. | |
| void | createUBOBuffer () |
| Create the GPU uniform buffer object for shader parameters. | |
| template<class t_point_type> | |
| void | getInput (PointContainer< t_point_type > &active) |
| Read back computed 3D positions and weights from the GPU. | |
| void | runAll (Buffer< RGBColor > &last_colors) |
| Dispatch the compute shader and read back colors. | |
| 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. | |
| void | updateImage (const uint01 *data, const Vector< 2, uint04 > &size) |
| Upload new depth data to the GPU texture. | |
| void | uploadInputs (const uint01 *depth, Vector< 2, uint04 > size) |
| Upload depth data and ensure GPU storage buffers are large enough. | |
Protected Attributes | |
| bool | has_normal = false |
| Whether the shader outputs normals. | |
| GLuint | m_csA = 0 |
| Compute shader handle. | |
| GLuint | m_depth_image = 0 |
| GPU texture handle for the depth image. | |
| Buffer< RGBColor > | m_last_colors |
| Previously computed color buffer. | |
| QOpenGLShaderProgram * | m_shader = nullptr |
| Compiled compute shader program. | |
| uint04 | m_size_i = 0 |
| Total number of pixels being processed. | |
| GLuint | m_ssboPos = 0 |
| Shader storage buffer for output positions. | |
| GLuint | m_ssboW = 0 |
| Shader storage buffer for output weights. | |
| GLuint | m_tex = 0 |
| Color texture handle. | |
| GLuint | m_uboU = 0 |
| Uniform buffer object handle. | |
GPU compute shader that converts depth and color raster frames into 3D colored point positions.
Uses OpenGL 4.3 compute shaders to unproject depth pixels into world-space 3D points, applying camera intrinsics (focal length, principal point, distortion coefficients) and an extrinsic view matrix. Outputs position and weight buffers consumed by the point pipeline.
Definition at line 16 of file ColorPositionShaderLogic.h.
Create the GPU depth image texture.
| [in] | size | Width and height of the depth image in pixels. |
Referenced by uploadInputs().
|
inline |
Read back computed 3D positions and weights from the GPU.
| [in,out] | active | Point container to receive the output positions and weights. |
Definition at line 63 of file ColorPositionShaderLogic.h.
References PointContainer< t_point_type >::clear(), PointContainer< t_point_type >::locations, m_size_i, m_ssboPos, m_ssboW, PointContainer< t_point_type >::setSize(), and PointContainer< t_point_type >::weights.
Dispatch the compute shader and read back colors.
| [in,out] | last_colors | Buffer to receive the computed color data. |
| void ColorPositionShaderLogic::setQtGL | ( | QOpenGLFunctions_4_3_Core * | gl | ) |
| void ColorPositionShaderLogic::setUBO | ( | const UBO & | u | ) |
Upload uniform buffer data to the GPU.
| [in] | u | The uniform buffer contents to upload. |
| void ColorPositionShaderLogic::updateImage | ( | const uint01 * | data, |
| const Vector< 2, uint04 > & | size ) |
Upload new depth data to the GPU texture.
| [in] | data | Raw depth image bytes. |
| [in] | size | Width and height of the depth image in pixels. |
Referenced by uploadInputs().
|
inline |
Upload depth data and ensure GPU storage buffers are large enough.
| [in] | depth | Raw depth image bytes. |
| [in] | size | Width and height of the depth image in pixels. |
Definition at line 80 of file ColorPositionShaderLogic.h.
References createImage(), m_depth_image, m_size_i, m_ssboPos, m_ssboW, and updateImage().