18 #ifndef DS3D_GLPROCESS_GL_LIDAR_RENDER_CTX_H
19 #define DS3D_GLPROCESS_GL_LIDAR_RENDER_CTX_H
21 #include "ds3d/common/common.h"
22 #include "ds3d/common/hpp/datamap.hpp"
23 #include "ds3d/common/hpp/frame.hpp"
25 #include "glprocess/gl_program.h"
26 #include "glprocess/gl_buf.h"
27 #include "glprocess/window.h"
28 #include "glprocess/gl_render_ctx.h"
29 #include "glprocess/gl_text.h"
30 #include "glprocess/gl_point_cloud_render_ctx.h"
31 #include "ds3d/glprocess/gl_cuda_utils.h"
33 namespace ds3d {
namespace gl {
53 {{-1048576.0f, 1048576.0f}}, {{-1048576.0f, 1048576.0f}}, {{-1048576.0f, 1048576.0f}}};
72 DS_ASSERT(elements == 3 || elements == 4);
73 _elementSize = elements;
76 void set3DBboxKey(
const std::string& key)
override { _lidarBboxName = key; }
80 _pointColor = {{color.
x / 255.0f, color.
y / 255.0f, color.
z / 255.0f, 1.0f}};
88 ErrCode configure(
const char* yamlConfig, uint32_t
size)
override;
92 uint32_t elementSize()
const {
return _elementSize; }
98 const Lidar3DBbox* bbox, uint32_t num, std::vector<vec3f>& boxBuf,
99 std::vector<vec4f>& colorBuf);
104 LidarRenderConfig _conf;
105 NormalViewPort _normalizedView;
106 bool _confParsed =
false;
108 std::unique_ptr<Program> _pointProgram;
109 std::unique_ptr<Program> _bboxProgram;
110 std::unique_ptr<Program> _textProgram;
112 std::unique_ptr<VertexArray> _pointsVao;
115 std::unique_ptr<VertexBuf> _bboxVertBuf;
116 std::unique_ptr<VertexBuf> _bboxColorBuf;
117 std::unique_ptr<VertexArray> _bboxVao;
119 std::unique_ptr<VertexBuf> _textVertexBuf;
120 std::unique_ptr<VertexBuf> _textUvBuf;
121 std::unique_ptr<VertexArray> _textVao;
122 std::vector<std::unique_ptr<Texture>> _textImages;
123 uint32_t _labelCount = 0;
125 bool _enableLabels =
false;
126 int _pointAttrib = -1;
129 vec4f _pointColor{{0, 1.0, 0, 1.0f}};
130 uint32_t _elementSize = 4;
141 #endif // DS3D_GLPROCESS_GL_LIDAR_RENDER_CTX_H