opensourceBIM / BIMsurfer

The latest version of the BIM Surfer WebGL viewer for IFC
MIT License
382 stars 132 forks source link

gl.readPixels returns allways empty array #78

Open tecnodcp opened 4 years ago

tecnodcp commented 4 years ago

Hi!

I'm using BIMSurfer 3 module at commit 129c91905e2947eb659870b1d4a72cd173966020, cherry-pickying 7a1ba86

The problem is that the click on the module doesn't select the object in some machines. Inspecting the problem we've figured out that the gl.readPixels returns an array [0,0,0,0].

This doesn't appends on all machines.

Inspecting more deeply we are supposing it depends on the driver version.

Configuration not working
running glxinfo | grep version
image

Configuration working
1 (ubuntu 18) this configuration had originally a mesa 16.x, after upgrading to 18 worked correctly image

2 (ubuntu 16) image

3 (ubuntu 18) image

Strange Configuration

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
   Vendor: nouveau (0x10de)
   Device: NV108 (0x1280)
   Version: 20.0.8
   Accelerated: yes
   Video memory: 2020MB
   Unified memory: no
   Preferred profile: core (0x1)
   Max core profile version: 4.3
   Max compat profile version: 4.3
   Max GLES1 profile version: 1.1
   Max GLES[23] profile version: 3.2
OpenGL vendor string: nouveau
OpenGL renderer string: NV108
OpenGL core profile version string: 4.3 (Core Profile) Mesa 20.0.8
OpenGL core profile shading language version string: 4.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.3 (Compatibility Profile) Mesa 20.0.8
OpenGL shading language version string: 4.30
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.0.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

This one is even stranger, with the commit 7a1ba86 is now possible to select elements by clicking them but seems like they are not rendered with the correct color, showing some elements only white.

Google versions for the tests are 83.0.4103.116
84.0.4147.125

We can't figure out which driver version works and if is correct to downgrade to MESA 18.0.0-rc5 or is only a BIMSurfer3 error.

So, how can we get the gl.readPixels working?