Question

I have written a small application to display large pointclouds of vertices of usual size ~ 20m points consisting of position values xyz and colour values RGB.

I experianced no issues on a workstation with a Nvidia GTX 670 GPU but have now changed to another workstation with a AMD HD6950 and now large pointclouds are not being displayed.

I originally thought that there might be a limit to the number of vertices that the AMD GPU can draw in a single call but after additional testing think that this is not the case.

I generated a test pointcloud (done with simple 'for' loops) larger then the other point clouds and with the same format [vc3(xyz) & vec3(rgb)] and this cloud still displays but not the other large pointcloud from the laser scanner. Looking at the VBO states in CodeXL these are all present and of the correct size (233MB for 20m vec3's) so i cannot see where the error might be unless the non-debug pointcloud is obtaining incorrect values from somewhere.

It's also worth noting that I have used small pointclouds (30k vertices) and they load fine but not the large ones on the AMD computer.

As a sanity check this is the code for generating the debug pointcloud:

// Holders for position and colour
std::vector<glm::vec3> t_position;
std::vector<glm::vec3> t_colour;

// Reserve memory
t_position.reserve(point_cloud_size);
t_colour.reserve(point_cloud_size);

// Generate Data
for (int x=0; x < cube_root; x++) {
    for (int y=0; y < cube_root; y++) {
        for (int z=0; z < cube_root; z++) {
            t_position.push_back(glm::vec3(x/10.0 - 0.5, y/10.0 -0.5, z/10.0 -0.5));
            t_colour.push_back(glm::vec3((float)x/10.0,(float)y/10.0,(float)z/10.0));
        }
    }
}

and this is the method for generating the laserscanner pointcloud:

pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr pointcloud (new pcl::PointCloud<pcl::PointXYZRGBNormal>);

if (pcl::io::loadPCDFile(point_cloud_path, *pointcloud) == -1) // Loading pointcloud from file path.
{
// Error Catch
    PCL_ERROR("Could not load pointcloud\n");
}

// Number of points in cloud
point_cloud_size = pointcloud->size();

// Sanity Check
std::cout << "Loaded Pointcloud of size: " << point_cloud_size << std::endl;

// Create data vectors
std::vector<glm::vec3> t_position;
std::vector<glm::vec3> t_colour;

// Reserve space in vectors for data
t_position.reserve(point_cloud_size);
t_colour.reserve(point_cloud_size);

// pointer for pcl data
pcl::PointXYZRGBNormal point_ptr;

std::cout << "Converting Pointcloud into vectors" << std::endl;
// Convert pointcloud to individual components (NEEDS OPTIMIZING)
for (int i = 0; i<point_cloud_size; i++) {

// Loading Bar for point cloud conversion
    loadbar(i, point_cloud_size);

    point_ptr = pointcloud->at(i);

    t_position.push_back(glm::vec3(point_ptr.x, point_ptr.y, point_ptr.z));
    t_colour.push_back(glm::vec3(point_ptr.r/255.0, point_ptr.g/255.0, point_ptr.b/255.0));
}

Both pointclouds are loaded to VBO's and VAO's with the same method:

BindPointCloud(t_position,t_colour);

So I cannot see the binding being the issue.

So I am pretty lost as to what the problem could be as it works fine on a workstation with a NVidia GPU but not an AMD one.

Any advice?

Was it helpful?

Solution 2

Problem was with the pointclouds coordinates.

There was a strange transformation being applied to the pointclouds so that they were not being rendered.

OTHER TIPS

In addition to AMD's own tools, gDEBugger is a good tool for this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top