加入渲染点的代码

This commit is contained in:
xsl
2025-09-17 22:47:48 +08:00
parent 64ebe51ea4
commit e4c89a2651
3 changed files with 311 additions and 8 deletions
+24 -2
View File
@@ -38,8 +38,29 @@ struct TextureLoadingVertexStructure
class TextureLoading : public ApiVulkanSample
{
public:
// Contains all Vulkan objects that are required to store and use a texture
// Note that this repository contains a texture class (vulkan_texture.h) that encapsulates texture loading functionality in a class that is used in subsequent demos
// --- 新增:用于点云渲染的结构 ---
struct PointVertex {
float x, y, z; // 位置
float r, g, b; // 颜色 (可以根据需要修改)
};
std::unique_ptr<vkb::core::BufferC> point_vertex_buffer;
uint32_t point_count = 0;
VkPipeline point_pipeline;
VkPipelineLayout point_pipeline_layout;
VkDescriptorSetLayout point_descriptor_set_layout;
VkDescriptorSet point_descriptor_set;
void setup_point_descriptor_set_layout();
void setup_point_descriptor_set();
void prepare_point_pipeline();
void update_point_vertex_buffer(float* pos, int pointCount);
void draw_point_cloud(VkCommandBuffer command_buffer);
void ReceiveFacePoint(float* pos, int pointCount, int width, int height);
void update_point_descriptor_set();
struct Texture
{
VkSampler sampler;
@@ -127,6 +148,7 @@ public:
//void run();
//void start();
std::mutex mtx;
std::mutex mtx_point;
//void stop();
//void updateTexture();
};