Various 3D issues on Linux with integrated graphics


#1

Hi, I spent maybe two hours trying to get something that looks like “normal shading”, but no matter what I do, I don’t see specular highlights nor normal shading (it’s either burnt white or ambient light).

I decided to try the 3DModelLoaderExample, just to see how it’s done there, and to my surprise, I can’t see any of the models by pressing keys 1 to 6.

I started to connect dots, and remembered that if I try to use ofVboMesh it crashes, and for that reason I can use ofxGui. Together with issue #5409 https://github.com/openframeworks/openFrameworks/issues/5409 (ofSaveFrame() crashes on my OF), I thought… hmmm… maybe there’s really something going wrong here? :slight_smile:

Otherwise it runs fine, I’m using OpenCV, playing videos and webcam, drawing 2D and non shaded 3D graphics fine.

I’m on ArchLinux, Intel 4600 graphics, updated packages including Intel driver, i3 tiling window manager, OF from Git.

Does any of this ring a bell somewhere?


#2

Some details:

  • 3D in other programs work fine. Shading is ok in Processing or Three.js.
  • ofxGui was working fine last summer. I compiled today a program that was running fine 6 months ago, and now crashes on ofVboMesh draw().
  • 3DModelLoaderExample logs no errors. The program runs, but shows nothing. I tried changing the background color to see if it was white on white background, but that’s not the case. The screen only shows the text instructions.
  • 3DPrimitivesExample only shows normals, no wireframe or faces visible. “Show axes” or “show lights” both crash the program; again because of vbos, on line 374 of ofGLRenderer.cpp (glDrawArrays).

#3

I’ll be at the Berlin meetup tomorrow, in case anyone wants to take a look :slight_smile:


#4

can you post a stacktrace of the crash? almost everything internally uses ofVboMesh to draw so it’s strange that it’s crashing if you explicitly use it in your code but only draw nothing if it’s used from OF internally


#5

This is what I see:

drawMode is 1, first is 0, total is 6. That happens on 3DPrimitivesExample when I press l to show the lights.

But even without triggering the crash, I wonder why are no shapes visible?


#6

It seems like all the issues I was having are resolved by what you mentioned yesterday at the OF meetup: in ofBufferObject.cpp, set GLEW_ARB_direct_state_access to false to disable code that does not work with my Intel Graphics 4600. After doing this, lights and shading works, ofSaveFrame() works too.

I see this comment in the code: “we use this to test whether the driver is OpenGL 4.5 ready”. This seems to be failing, because in my computer the variable is set to true even if according to

glxinfo | grep "version"

4.5 is not available:

server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 3.3
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL core profile version string: 3.3 (Core Profile) Mesa 13.0.3
OpenGL core profile shading language version string: 3.30
OpenGL version string: 3.0 Mesa 13.0.3
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 13.0.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

#7

can you post the output of grep | direct_state_access here: https://github.com/openframeworks/openFrameworks/issues/5422


#8

FWIW, OpenGL 4.5 is coming to Haswell (which includes the HD4600). You just need to update to Mesa 17…if you are on Ubuntu there’s a ppa for that, the padoka:

https://launchpad.net/~paulo-miguel-dias/+archive/ubuntu/pkppa

More info here:

http://www.phoronix.com/scan.php?page=news_item&px=Mesa-17.0-Gets-Haswell-GL45


#9

Nice! Thanks for the news :slight_smile:

It seems like my system was updated, because now running the same command above, I get this:

server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 4.5
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.0.0
OpenGL core profile shading language version string: 4.50
OpenGL version string: 3.0 Mesa 17.0.0
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 17.0.0
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

#10

In case this happens to anyone else, I wanted to point out that the github master version still suffers from the same issue on my system with Intel Graphics 4600, even if it should be supporting GL 4.5 now.

In ofBufferObject.cpp I need to replace every (8) instance of

if (GLEW_ARB_direct_state_access) {

with

if(false) {

to get 3D rendering work, which I test by running 3DPrimitivesExample.