Closed omichel closed 5 years ago
After some investigation, I found that the problem comes from the depth value returned by wr_frame_buffer_copy_depth_pixel
here which is slightly too big on VMware. It might by another OpenGL bug on VMware...
As a confirmation of this, all the lidars seem to be broken on VMware, for example the samples / devices / lidar.wbt is broken.
I can reproduce the GPU picking issue, but not the Lidar issues (the examples are working smoothly in my environment).
glReadPixels(..., 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, data) works, but returns distorted data.
This distortion is perfectly a square root function, therefore adding the following adjustment function after the glReadPixel solves the issue:
GLfloat *fData = (GLfloat *) data;
fData[0] = fData[0] * fData[0];
Remains to determine why.
Depth buffer content when picking:
Well spotted!
wow!
I investigated more the lidar issue. It's not related with depth buffer: Lidar and RangeFinder are using shaders. The content is correct, but is obfuscate by some object:
The problematic object is this black sphere:
Removing the sphere let the things work smoothly.
I will check tomorrow if it's not a near issue. I'm close to provide a clean fix.
This sphere is almost coplanar with the lidar near plane (at 0.005 millimeters). Probably that the depth precision affects the detection of this object. There is no issues with back faces. So increasing the near plane or changing the position of the sphere are clean fixes.
Describe the Bug The rotation of the viewpoint around the picked point doesn't work.
Steps to Reproduce
Expected behavior It should behave like on other platforms.
System