isl-org / isl-org/Open3D

400x200 VoxelGrid UpdateGeometry very slow

Open
#5,823 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

I'm generating a 400x200x1 voxel grid and based on the occupancy of each voxel, I'm recoloring the voxels and then calling UpdateGeometry() in the render loop.

Based on my timing analysis, UpdateGeometry() step takes a lot of time (~x100 the time it takes to update the entire voxel grid color):

updating voxel grid: 0.00397033 sec.
calling UpdateGeometry: 0.115679 sec.

Here's my setup:

Initialize the visualier:

```
// Voxel
voxelGrid_ = std::make_shared();
voxelGrid_->origin_ = Eigen::Vector3d(0.0, 0.0, 0.0);
voxelGrid_->voxel_size_ = GRID_RESOLUTION_;

for (int col = 0; col < NUM_COLS_; col++)
{
for (int row = 0; row < NUM_ROWS_; row++)
{
Eigen::Vector3i voxelIdx(col, row, 0);
Eigen::Vector3d color(0.5, 0.5, 0.5);
voxelGrid_->AddVoxel(open3d::geometry::Voxel(voxelIdx, color));
}
}
gridViz_.AddGeometry(voxelGrid_);
```

Main perception loop:

```
for (auto &voxel : voxelGrid_->voxels_)
voxel.second.color_ = assigned_color;
```

Render loop:
```
gridViz_.UpdateGeometry(voxelGrid_);
gridViz_.PollEvents();
gridViz_.UpdateRender();
```

As I mentioned, Render loop's UpdateGeometry step seems to be the culprit. But I'm sure updating a 400x200x1 voxel grid should not take so much time. Can somebody point me to what I might be missing?

Hardware: AMD Ryzen 5 2600x, Nvidia GTX1660Ti, 16GB RAM

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.