Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGL 3.3 fallback #28

Closed
Calinou opened this issue Mar 30, 2015 · 115 comments
Closed

OpenGL 3.3 fallback #28

Calinou opened this issue Mar 30, 2015 · 115 comments

Comments

@Calinou
Copy link
Collaborator

Calinou commented Mar 30, 2015

Could you please add an OpenGL 3.0/3.1/3.2/3.3 fallback? Until Nouveau and other free drivers like Radeon and Intel implement OpenGL 4.0, I can't run this, even though the program builds successfully. This is on Debian jessie 64-bit.

@kmkolasinski
Copy link
Owner

Hi, sorry but I have no time to make AB work with 3.3 and lower openGL versions :/

@ghost
Copy link

ghost commented Mar 30, 2015

Hi, AB doesn't support versions of OpenGL lower than 4.0, mainly because of the tessellation feature. You can run AwesomeBump on your computer by using a different set of drivers. I'm assuming you're using a NVIDIA graphics card. Open your terminal and type in sudo add-apt-repository ppa:xorg-edgers/ppa -y. When that finishes, sudo apt-get update, and then sudo apt-get install nvidia-current. Open your Additional Drivers window, and select "NVIDIA binary drivers - version 340.76 from nvidia-340". To get CUDA support, sudo apt-get install nvidia-modprobe. You'll have to reboot.

@kmkolasinski
Copy link
Owner

Another question: does your GPU use the Optimus technology?

@Calinou
Copy link
Collaborator Author

Calinou commented Mar 30, 2015

No, this is a desktop PC.

Hi, AB doesn't support versions of OpenGL lower than 4.0, mainly because of the tessellation feature. You can run AwesomeBump on your computer by using a different set of drivers. I'm assuming you're using a NVIDIA graphics card. Open your terminal and type in sudo add-apt-repository ppa:xorg-edgers/ppa -y. When that finishes, sudo apt-get update, and then sudo apt-get install nvidia-current. Open your Additional Drivers window, and select "NVIDIA binary drivers - version 340.76 from nvidia-340". To get CUDA support, sudo apt-get install nvidia-modprobe. You'll have to reboot.

Please, don't suggest people to use proprietary software. Don't suggest PPAs to Debian users either. Really, there are a lot of people with cards that don't support OpenGL 4.0. Can't you just disable the tesselation feature somewhere in configuration?

PS: I have modified and recompiled the program to remove the check, but it segfaults on start.

@kmkolasinski
Copy link
Owner

It will segfaults for sure, your card does not support openGL 4.0 (or use have intel graphics card).
Did you read my comment to issue: #31

What wrong is with proprietary drivers?

@ghost
Copy link

ghost commented Mar 30, 2015

The X-edgers drivers are open-source...I use OpenSUSE and Ubuntu, never tried Debian. I thought the process would be the same on Debian as it is on Ubuntu.

@Calinou
Copy link
Collaborator Author

Calinou commented Mar 31, 2015

The X-edgers drivers are open-source...

No, the NVIDIA driver you're telling me to install is a proprietary blob, that also breaks on every kernel update unless you're using hacks like DKMS.

What wrong is with proprietary drivers?

It is poorly regarded in the free/libre software community to recommend proprietary software like this.

@kmkolasinski
Copy link
Owner

Hi, I need people to test a new version of AB. I've added some improvements to support openGL 3.30.
See this file and step 8: https://github.com/kmkolasinski/AwesomeBump/releases/download/BuildingAB/BuildingInstruction.pdf
Basically you just have to define a new variable or create a new build configuration "CONFIG+=release_gl330". See how it works in Qt pro file:
CONFIG(release_gl330) {
#This is a release build
DEFINES += USE_OPENGL_330
TARGET = AwesomeBumpGL330
} else {
TARGET = AwesomeBump
#This is a debug build
}

@swamp-fish
Copy link

Hi, my card and driver have OpenGL3.3 support yet program says it doesn't. I'm using OSS driver.
glxinfo | grep -i opengl
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD JUNIPER
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.3.2
OpenGL core profile shading language version string: 3.30

@ghost
Copy link

ghost commented May 24, 2015

Which version is AwesomeBump using? Check the log.txt file.

@swamp-fish
Copy link

[24/05/2015 21:00:00] {Debug} Starting application:
[24/05/2015 21:00:00] {Debug} "Running the AwesomeBump 4.0 Beta (2015) (openGL 330 release)"
[24/05/2015 21:00:00] {Debug} Checking OpenGL version...
[24/05/2015 21:00:00] {Debug} Widget OpenGL: 3 . 0
[24/05/2015 21:00:00] {Debug} Context valid: true
[24/05/2015 21:00:00] {Debug} OpenGL information:
[24/05/2015 21:00:00] {Debug} VENDOR: X.Org
[24/05/2015 21:00:00] {Debug} RENDERER: Gallium 0.4 on AMD JUNIPER
[24/05/2015 21:00:00] {Debug} VERSION: 3.0 Mesa 10.3.2
[24/05/2015 21:00:00] {Debug} GLSL VERSION: 1.30
[24/05/2015 21:00:00] {Debug} Version: 3
[24/05/2015 21:00:00] {Debug} Error: This version of AwesomeBump does not support openGL versions lower than 3.3 :(

@ghost
Copy link

ghost commented May 24, 2015

Hm, that's strange. I don't really know what's going on with that, @kmkolasinski might know.

@kmkolasinski
Copy link
Owner

Hi, there is a problem which I don't understand :/ It seems that QT does not recognize your version of openGL.
Just see the log file: it says that the gl version is 3.0, but you need 3.3 to run AB.
Did you try ti use: primusrun or optirun commands? Maybe your drivers are causing problems.

@swamp-fish
Copy link

What has technologies for Nvidia GPUs to do with an AMD card?
Drivers seems to be working just fine, Houdini recognizes OpenGL3.3(it has OpenGL3.2 viewport and some time ago it was enabled by default so the ones who had no support couldn't even run it) for years already, kwin recognizes it and i can use OpenGL3.1 compositing, glxinfo lists all extensions from it as well as pointing out that core profile is 3.3 while the minimum is 3.0. Core profile is used by default.

Here is full output of glxinfo http://justpaste.it/lcfq

Also i've found this https://wiki.qt.io/How_to_use_OpenGL_Core_Profile_with_Qt maybe it'll help

@kmkolasinski
Copy link
Owner

The author of this issue also uses the OpenSource drivers and he has the same problems (I think so). I just don't trust Mesa drivers. You can try to modify the code and compile it using the suggestions in the link above, but I'm quite sure it wont help you.
@Terrance8D did you try to use open source drivers?
@swamp-fish Could you build AB from source?
Currently I'm very busy and I don't have time for AB.

@ghost
Copy link

ghost commented May 26, 2015

I have used the open source Nouveau drivers with AwesomeBump before, but that didn't work because they're only up to OpenGL 2.1 since last time I checked. Switching between Nouveau and the proprietary drivers on Linux is sort of complicated, but nothing that an Arch Linux user can't handle.;) I'll try them out again and report back here.

@swamp-fish
Copy link

I am not a programmer so unfortunately i can't rewrite anything just making what i can and report a problem.

@ghost
Copy link

ghost commented May 26, 2015

@swamp-fish There is a Linux build script included in the source files, just chmod +x it and run it, it will compile everything for you.
@kmkolasinski Unfortunately I wasn't ale to test the open source drivers with AB. After I installed them I couldn't start a graphical session due to a fatal error that was caused by them. Luckily I configured my system to boot into tty, right?;)

@kmkolasinski
Copy link
Owner

I'm not sure that rebuilding AB may help. As you see: @Terrance8D , @Calinou and you had the same problem with open source drivers. I think you could even find more users who can confirm that.

@swamp-fish
Copy link

It didn't compile anything it wants qmake, i don't know where to get it.
And it seems i'm not the only one, Mac user with the same problem:
http://blenderartists.org/forum/showthread.php?366395-AwesomeBump-3-0-beta-released!&p=2881110&viewfull=1#post2881110

@illwieckz
Copy link
Contributor

Hi, I face the same problem, OpenGL 3.3 here but AwesomeBump says I have GL 3.0

$ glxinfo | grep ' vendor \| renderer \| core profile version \| core profile shading '
server glx vendor string: SGI
client glx vendor string: Mesa Project and SGI
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD TAHITI
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.7.0-devel (git-7830e46 2015-07-31 vivid-oibaf-ppa)
OpenGL core profile shading language version string: 3.30
$ cat log.txt 
[31/07/2015 10:22:21] {Debug}        Starting application:
[31/07/2015 10:22:21] {Debug}        "Running the AwesomeBump 4.0 Beta (2015) (openGL 330 release)"
[31/07/2015 10:22:21] {Debug}        Checking OpenGL version...
[31/07/2015 10:22:21] {Debug}        Widget OpenGL:  3 . 0
[31/07/2015 10:22:21] {Debug}        Context valid:  true
[31/07/2015 10:22:21] {Debug}        OpenGL information: 
[31/07/2015 10:22:21] {Debug}        VENDOR:  X.Org
[31/07/2015 10:22:21] {Debug}        RENDERER:  Gallium 0.4 on AMD TAHITI
[31/07/2015 10:22:21] {Debug}        VERSION:  3.0 Mesa 10.7.0-devel (git-7830e46 2015-07-31 vivid-oibaf-ppa)
[31/07/2015 10:22:21] {Debug}        GLSL VERSION:  1.30
[31/07/2015 10:22:21] {Debug}        Version: 3
[31/07/2015 10:22:21] {Debug}        Error: This version of AwesomeBump does not support openGL versions lower than 3.3 :(

Perhaps the program checks the Mesa version instead of the OpenGL core profile?

What wrong is with proprietary drivers?

They do not work at all on my computer (i.e. system freeze) and even mesa nightly builds are more stable and safer than proprietary drivers. Proprietary drivers are not an option.

@illwieckz
Copy link
Contributor

If I bypass checkOpenGL and build the GL330 version I get:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004b6203 in GLTexture::GLTexture() ()
(gdb) bt
#0  0x00000000004b6203 in GLTexture::GLTexture() ()
#1  0x00000000004b75f4 in GLTextureCube::GLTextureCube(QStringList const&, int) ()
#2  0x0000000000416986 in GLWidget::chooseSkyBox(QString, bool) ()
#3  0x00000000004456e4 in MainWindow::MainWindow(QWidget*) ()
#4  0x0000000000412b7e in main ()

@J5lx
Copy link

J5lx commented Jul 31, 2015

Well, only the core profile is 3.3:

$ glxinfo | grep 'OpenGL.*version'
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.6.3
OpenGL core profile shading language version string: 3.30
OpenGL version string: 3.0 Mesa 10.6.3
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 10.6.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

Also, from http://mesa3d.org/relnotes/10.6.3.html:

OpenGL 3.3 is only available if requested at context creation because compatibility contexts are not supported.

This sentence has been present in the release notes ever since support for 3.3 has been added, and it has also been present for 3.1 before (Mesa 9). As it seems AwesomeBump requests the exact OpenGL version on OS X already, probably this should be done on Linux as well.

@kmkolasinski
Copy link
Owner

Hi,
so you mean that the problem is only on the linux systems?

@J5lx
Copy link

J5lx commented Aug 3, 2015

I’ll summarise what I mean in a list;

  • Mesa is an Open Source implementation of the OpenGL spec for Linux
  • It supports OpenGL 3.3 since version 10
  • However, it does not support OpenGL compatibility contexts
  • Therefore programs that want to use OpenGL 3.3 with Mesa need to request this particular version at context creation
  • To me it seems like AwesomeBump does exactly this already on OS X for OpenGL 4.1, due to this piece of code in main.cpp
  • If my understanding of the problem is correct, it should be possible to fix the problem by doing exactly the same on Linux for OpenGL 3.3

so you mean that the problem is only on the linux systems?

AFAIK it does only affect Linux systems using Mesa. However I might be wrong, since I haven’t actually used any other OpenGL implementations / drivers than Mesa yet.

@J5lx
Copy link

J5lx commented Aug 3, 2015

If it helps, I think this code should fix it:

#ifdef Q_OS_LINUX
    glFormat.setProfile( QGLFormat::CoreProfile );
    glFormat.setVersion( 3, 3 );
#endif

However I know neither Qt nor C++, so this is mainly based on guessing and the actual solution might look a bit different.

@kmkolasinski
Copy link
Owner

Wow great, thank you for the explanation. I just committed the solution proposed by you.
Did anyone of you tried to build AB with this modification and test it on Mesa drivers?

@illwieckz
Copy link
Contributor

I get same segfault I got before when I replaced if (!checkOpenGL()) by if (false) (see my comment above).

It means the patch by @J5lx works, but AwesomeBumpGL330 segfault on my GL3.3 system.

gbd backtraces:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004b6203 in GLTexture::GLTexture() ()
(gdb) thread apply all bt

Thread 6 (Thread 0x7fffed006700 (LWP 20535)):
#0  0x00007ffff5f0e8dd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007ffff2875b72 in  () at /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007ffff287764f in xcb_wait_for_event () at /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007ffff7eb0099 in  () at /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so
#4  0x00007ffff6d45b0e in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff5bfc6aa in start_thread (arg=0x7fffed006700) at pthread_create.c:333
#6  0x00007ffff5f19eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 5 (Thread 0x7fffdeb31700 (LWP 20536)):
#0  0x00007ffff5f0e8dd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007ffff56ddebc in g_main_context_iterate (priority=2147483647, n_fds=3, fds=0x7fffd80010c0, timeout=-1, context=0xbad830)
    at /build/buildd/glib2.0-2.44.1/./glib/gmain.c:4103
#2  0x00007ffff56ddebc in g_main_context_iterate (context=0xbad830, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /build/buildd/glib2.0-2.44.1/./glib/gmain.c:3803
#3  0x00007ffff56de242 in g_main_loop_run (loop=0xbad7c0) at /build/buildd/glib2.0-2.44.1/./glib/gmain.c:4002
#4  0x00007fffe68f0af6 in gdbus_shared_thread_func (user_data=0xbad800) at /build/buildd/glib2.0-2.44.1/./gio/gdbusprivate.c:274
#5  0x00007ffff5704955 in g_thread_proxy (data=0xb6ab70) at /build/buildd/glib2.0-2.44.1/./glib/gthread.c:764
#6  0x00007ffff5bfc6aa in start_thread (arg=0x7fffdeb31700) at pthread_create.c:333
#7  0x00007ffff5f19eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 4 (Thread 0x7fffde330700 (LWP 20537)):
#0  0x00007ffff5f0e8dd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007ffff56ddebc in g_main_context_iterate (priority=2147483647, n_fds=2, fds=0x7fffd00008c0, timeout=-1, context=0xbb75e0)
    at /build/buildd/glib2.0-2.44.1/./glib/gmain.c:4103
#2  0x00007ffff56ddebc in g_main_context_iterate (context=context@entry=0xbb75e0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /build/buildd/glib2.0-2.44.1/./glib/gmain.c:3803
#3  0x00007ffff56ddfcc in g_main_context_iteration (context=0xbb75e0, may_block=may_block@entry=1) at /build/buildd/glib2.0-2.44.1/./glib/gmain.c:3869
#4  0x00007ffff56de009 in glib_worker_main (data=<optimized out>) at /build/buildd/glib2.0-2.44.1/./glib/gmain.c:5618
#5  0x00007ffff5704955 in g_thread_proxy (data=0xb6ade0) at /build/buildd/glib2.0-2.44.1/./glib/gthread.c:764
#6  0x00007ffff5bfc6aa in start_thread (arg=0x7fffde330700) at pthread_create.c:333
#7  0x00007ffff5f19eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7fffdd32e700 (LWP 20540)):
#0  0x00007ffff5f145a9 in syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff5722a0a in g_cond_wait_until (cond=cond@entry=0xbb8e28, mutex=mutex@entry=0xbb8e20, end_time=end_time@entry=95698242714)
    at /build/buildd/glib2.0-2.44.1/./glib/gthread-posix.c:1442
#2  0x00007ffff56b2889 in g_async_queue_pop_intern_unlocked (queue=queue@entry=0xbb8e20, wait=wait@entry=1, end_time=end_time@entry=95698242714)
    at /build/buildd/glib2.0-2.44.1/./glib/gasyncqueue.c:422
#3  0x00007ffff56b2eab in g_async_queue_timeout_pop (queue=0xbb8e20, timeout=timeout@entry=15000000) at /build/buildd/glib2.0-2.44.1/./glib/gasyncqueue.c:543
#4  0x00007ffff57053ac in g_thread_pool_thread_proxy () at /build/buildd/glib2.0-2.44.1/./glib/gthreadpool.c:167
#5  0x00007ffff57053ac in g_thread_pool_thread_proxy (data=<optimized out>) at /build/buildd/glib2.0-2.44.1/./glib/gthreadpool.c:364
#6  0x00007ffff5704955 in g_thread_proxy (data=0x7fffd8004450) at /build/buildd/glib2.0-2.44.1/./glib/gthread.c:764
#7  0x00007ffff5bfc6aa in start_thread (arg=0x7fffdd32e700) at pthread_create.c:333
#8  0x00007ffff5f19eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7fffccefb700 (LWP 20542)):
#0  0x00007ffff5c01da0 in pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007fffcfa0af43 in  () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so
#2  0x00007fffcfa0a568 in  () at /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so
#3  0x00007ffff5bfc6aa in start_thread (arg=0x7fffccefb700) at pthread_create.c:333
#4  0x00007ffff5f19eed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7ffff7f40780 (LWP 20531)):
#0  0x00000000004b6203 in GLTexture::GLTexture() ()
#1  0x00000000004b75f4 in GLTextureCube::GLTextureCube(QStringList const&, int) ()
#2  0x0000000000416986 in GLWidget::chooseSkyBox(QString, bool) ()
#3  0x00000000004456e4 in MainWindow::MainWindow(QWidget*) ()
#4  0x0000000000412b7e in main ()

log.txt :

[04/08/2015 12:12:06] {Debug}        Starting application:
[04/08/2015 12:12:07] {Debug}        Loading cubemaps folders:
[04/08/2015 12:12:07] {Debug}        Reading the list of available configs settings:
[04/08/2015 12:12:07] {Debug}        Supported GUI styles:  "Breeze, Windows, GTK+, Fusion"
[04/08/2015 12:12:07] {Debug}        Load settings:
[04/08/2015 12:12:07] {Debug}        Calling void MainWindow::loadSettings()  loading from  "config.ini"
[04/08/2015 12:12:07] {Debug}        ATI    RAM Left= "0" [MB]
[04/08/2015 12:12:07] {Debug}        NVIDIA RAM Left= "0" [MB]
[04/08/2015 12:12:07] {Debug}        Just checking possible error after memory call: GL_ ""  -  mainwindow.cpp : 663
[04/08/2015 12:12:07] {Debug}        Changing 3D settings
[04/08/2015 12:12:07] {Debug}        ATI    RAM Left= "0" [MB]
[04/08/2015 12:12:07] {Debug}        NVIDIA RAM Left= "0" [MB]
[04/08/2015 12:12:07] {Debug}        Just checking possible error after memory call: GL_ ""  -  mainwindow.cpp : 663
[04/08/2015 12:12:07] {Debug}        void FBOImageProporties::init(QImage&)
[04/08/2015 12:12:07] {Debug}        FBOImages::creating new FBO( 512 , 512 ) with id= 2
[04/08/2015 12:12:07] {Debug}        void FBOImageProporties::init(QImage&)
[04/08/2015 12:12:07] {Debug}        FBOImages::creating new FBO( 512 , 512 ) with id= 4
[04/08/2015 12:12:07] {Debug}        void FBOImageProporties::init(QImage&)
[04/08/2015 12:12:07] {Debug}        FBOImages::creating new FBO( 512 , 512 ) with id= 6
[04/08/2015 12:12:07] {Debug}        void FBOImageProporties::init(QImage&)
[04/08/2015 12:12:07] {Debug}        FBOImages::creating new FBO( 512 , 512 ) with id= 8
[04/08/2015 12:12:07] {Debug}        void FBOImageProporties::init(QImage&)
[04/08/2015 12:12:07] {Debug}        FBOImages::creating new FBO( 512 , 512 ) with id= 10
[04/08/2015 12:12:07] {Debug}        void FBOImageProporties::init(QImage&)
[04/08/2015 12:12:07] {Debug}        FBOImages::creating new FBO( 512 , 512 ) with id= 12
[04/08/2015 12:12:07] {Debug}        void FBOImageProporties::init(QImage&)
[04/08/2015 12:12:07] {Debug}        FBOImages::creating new FBO( 512 , 512 ) with id= 14
[04/08/2015 12:12:07] {Debug}        void FBOImageProporties::init(QImage&)
[04/08/2015 12:12:07] {Debug}        FBOImages::creating new FBO( 512 , 512 ) with id= 16
[04/08/2015 12:12:07] {Debug}        Material index:   0  Color : QColor(ARGB 1, 0, 0, 0)
[04/08/2015 12:12:07] {Debug}        Material index:   16646655  Color : QColor(ARGB 1, 1, 1, 1)
[04/08/2015 12:12:07] {Debug}        Updating material indices. Total indices count: 2
[04/08/2015 12:12:07] {Debug}        void FBOImageProporties::init(QImage&)
[04/08/2015 12:12:07] {Debug}        FBOImages::creating new FBO( 512 , 512 ) with id= 18
[04/08/2015 12:12:07] {Debug}        ATI    RAM Left= "0" [MB]
[04/08/2015 12:12:07] {Debug}        NVIDIA RAM Left= "0" [MB]
[04/08/2015 12:12:07] {Debug}        Just checking possible error after memory call: GL_ "INVALID_ENUM"  -  mainwindow.cpp : 663
[04/08/2015 12:12:07] {Debug}        Loading cubemaps folders:
[04/08/2015 12:12:07] {Debug}        fphath2: "Core/2D/skyboxes"
[04/08/2015 12:12:07] {Debug}        Reading new cube map: ("Core/2D/skyboxes//posx.jpg", "Core/2D/skyboxes//negx.jpg", "Core/2D/skyboxes//posy.jpg", "Core/2D/skyboxes//negy.jpg", "Core/2D/skyboxes//posz.jpg", "Core/2D/skyboxes//negz.jpg")

@kmkolasinski
Copy link
Owner

Ok, but could you execute the checkOpenGL() before the if statement? Current log file does not show the created version of openGL context.

@illwieckz
Copy link
Contributor

Well, something was wrong with my source tree, after some cleaning it launchs now but is still complaining about GL3.3, the log.txt says:

 [05/08/2015 12:47:49] {Debug}       Starting application:
[05/08/2015 12:47:49] {Debug}        "Running the AwesomeBump 4.0 Beta (2015) (openGL 330 release)"
[05/08/2015 12:47:49] {Debug}        Checking OpenGL version...
[05/08/2015 12:47:49] {Debug}        Widget OpenGL: "3.3"
[05/08/2015 12:47:49] {Debug}        Context valid: true
[05/08/2015 12:47:49] {Debug}        OpenGL information:
[05/08/2015 12:47:49] {Debug}        VENDOR: X.Org
[05/08/2015 12:47:49] {Debug}        RENDERER: Gallium 0.4 on AMD TAHITI
[05/08/2015 12:47:49] {Debug}        VERSION: 3.3 (Core Profile) Mesa 11.0.0-devel (git-de59a40 2015-08-03 vivid-oibaf-ppa)
[05/08/2015 12:47:49] {Debug}        GLSL VERSION: 3.30
[05/08/2015 12:47:49] {Debug}        Version: 3.3
[05/08/2015 12:47:49] {Debug}        Error: This version of AwesomeBump does not support openGL versions lower than 3.3 :(
[05/08/2015 12:47:49] {Debug}        QOpenGLContext(0x11ea6e0)

@illwieckz
Copy link
Contributor

[17/08/2015 20:33:16] {Debug}            Widget OpenGL: "4.1"
[17/08/2015 20:33:16] {Debug}            Context valid: true
[17/08/2015 20:33:16] {Debug}            OpenGL information:
[17/08/2015 20:33:16] {Debug}            VENDOR: X.Org
[17/08/2015 20:33:16] {Debug}            RENDERER: Gallium 0.4 on AMD TAHITI (DRM 2.42.0, LLVM 3.6.2)
[17/08/2015 20:33:16] {Debug}            VERSION: 4.1 Mesa 11.0.0-devel (git-d9603be 2015-08-13 vivid-oibaf-ppa)

But the 4.1 VERSION is a version I faked to try the windows builds, I will try with a legacy build (announcing 3.0 version and 4.1 core profile), I just need to recompile mesa.

@kmkolasinski
Copy link
Owner

Ok, I will try other things.

@kmkolasinski
Copy link
Owner

What if you change: glFormat.setProfile(QGLFormat::CompatibilityProfile);

@illwieckz
Copy link
Contributor

With that:

$ glxinfo | grep OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD TAHITI (DRM 2.42.0, LLVM 3.6.2)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.0.0-devel (git-5af71fb 2015-08-17 vivid-oibaf-ppa)
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 11.0.0-devel (git-5af71fb 2015-08-17 vivid-oibaf-ppa)
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 11.0.0-devel (git-5af71fb 2015-08-17 vivid-oibaf-ppa)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

and that:

$ grep 'glFormat.set' Sources/main.cpp
    glFormat.setProfile( QGLFormat::CoreProfile );
    glFormat.setVersion( GL_MAJOR, GL_MINOR );

I get that:

$head -n 11 Bin/log.txt 
[17/08/2015 20:53:37] {Debug}        Starting application:
[17/08/2015 20:53:37] {Debug}        "Running the AwesomeBump 4.0 Beta (2015) (openGL 330 release)"
[17/08/2015 20:53:37] {Debug}        Checking OpenGL version...
[17/08/2015 20:53:37] {Debug}        Widget OpenGL: "3.3"
[17/08/2015 20:53:37] {Debug}        Context valid: true
[17/08/2015 20:53:37] {Debug}        OpenGL information:
[17/08/2015 20:53:37] {Debug}        VENDOR: X.Org
[17/08/2015 20:53:37] {Debug}        RENDERER: Gallium 0.4 on AMD TAHITI (DRM 2.42.0, LLVM 3.6.2)
[17/08/2015 20:53:37] {Debug}        VERSION: 3.3 (Core Profile) Mesa 11.0.0-devel (git-5af71fb 2015-08-17 vivid-oibaf-ppa)
[17/08/2015 20:53:37] {Debug}        GLSL VERSION: 3.30
[17/08/2015 20:53:37] {Debug}        "Version: 3.3"

I get AwesomeBump launch but no rendering.

With the same glxinfo but with that:

$ grep 'glFormat.set' Sources/main.cpp
     glFormat.setProfile( QGLFormat::CoreProfile );

I get that:

$ head -n 11 Bin/log.txt 
[17/08/2015 20:58:55] {Debug}        Starting application:
[17/08/2015 20:58:55] {Debug}        "Running the AwesomeBump 4.0 Beta (2015) (openGL 330 release)"
[17/08/2015 20:58:55] {Debug}        Checking OpenGL version...
[17/08/2015 20:58:55] {Debug}        Widget OpenGL: "3.0"
[17/08/2015 20:58:55] {Debug}        Context valid: true
[17/08/2015 20:58:55] {Debug}        OpenGL information:
[17/08/2015 20:58:55] {Debug}        VENDOR: X.Org
[17/08/2015 20:58:55] {Debug}        RENDERER: Gallium 0.4 on AMD TAHITI (DRM 2.42.0, LLVM 3.6.2)
[17/08/2015 20:58:55] {Debug}        VERSION: 3.0 Mesa 11.0.0-devel (git-5af71fb 2015-08-17 vivid-oibaf-ppa)
[17/08/2015 20:58:55] {Debug}        GLSL VERSION: 1.30
[17/08/2015 20:58:55] {Debug}        "Version: 3.0"

And AwesomeBump (for GL 3.3) does not launch.

@illwieckz
Copy link
Contributor

What if you change: glFormat.setProfile(QGLFormat::CompatibilityProfile);

will try

@illwieckz
Copy link
Contributor

head -n 11 Bin/log.txt 
[17/08/2015 21:01:16] {Debug}        Starting application:
[17/08/2015 21:01:16] {Debug}        "Running the AwesomeBump 4.0 Beta (2015) (openGL 330 release)"
[17/08/2015 21:01:16] {Debug}        Checking OpenGL version...
[17/08/2015 21:01:16] {Debug}        Widget OpenGL: "3.0"
[17/08/2015 21:01:16] {Debug}        Context valid: true
[17/08/2015 21:01:16] {Debug}        OpenGL information:
[17/08/2015 21:01:16] {Debug}        VENDOR: X.Org
[17/08/2015 21:01:16] {Debug}        RENDERER: Gallium 0.4 on AMD TAHITI (DRM 2.42.0, LLVM 3.6.2)
[17/08/2015 21:01:16] {Debug}        VERSION: 3.0 Mesa 11.0.0-devel (git-5af71fb 2015-08-17 vivid-oibaf-ppa)
[17/08/2015 21:01:16] {Debug}        GLSL VERSION: 1.30
[17/08/2015 21:01:16] {Debug}        "Version: 3.0"

And AwesomeBump for GL 3.3 (on Mesa core profile 3.3) does not launch (version complain).

I will try now with AwesomeBump for GL 4.1 with a Mesa core profile 4.1.

@kmkolasinski
Copy link
Owner

I have the same output on my intel card on linux. So I have possibility test it now.

@kmkolasinski
Copy link
Owner

I think there is no simple solution for this problem: I tested the "boxes" Qt example and it works on my intel but they use default openGL -- (with Mesa this is openGL 3.0) and they load the necessary extensions manually :/

@illwieckz
Copy link
Contributor

So now:

$ glxinfo | grep OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD TAHITI (DRM 2.42.0, LLVM 3.8.0)
OpenGL core profile version string: 4.1 (Core Profile) Mesa 11.0.0-devel (git-5af71fb 2015-08-17 vivid-oibaf-ppa)
OpenGL core profile shading language version string: 4.10
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 11.0.0-devel (git-5af71fb 2015-08-17 vivid-oibaf-ppa)
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 11.0.0-devel (git-5af71fb 2015-08-17 vivid-oibaf-ppa)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

with:

$ grep 'glFormat.set' Sources/main.cpp 
    glFormat.setProfile( QGLFormat::CoreProfile );
    glFormat.setVersion( GL_MAJOR, GL_MINOR );

I get:

$ head -n 11 Bin/log.txt 
[17/08/2015 21:27:53] {Debug}        Starting application:
[17/08/2015 21:27:53] {Debug}        "Running the AwesomeBump 4.0 Beta (2015)"
[17/08/2015 21:27:53] {Debug}        Checking OpenGL version...
[17/08/2015 21:27:53] {Debug}        Widget OpenGL: "4.1"
[17/08/2015 21:27:53] {Debug}        Context valid: true
[17/08/2015 21:27:53] {Debug}        OpenGL information:
[17/08/2015 21:27:53] {Debug}        VENDOR: X.Org
[17/08/2015 21:27:53] {Debug}        RENDERER: Gallium 0.4 on AMD TAHITI (DRM 2.42.0, LLVM 3.8.0)
[17/08/2015 21:27:53] {Debug}        VERSION: 4.1 (Core Profile) Mesa 11.0.0-devel (git-5af71fb 2015-08-17 vivid-oibaf-ppa)
[17/08/2015 21:27:53] {Debug}        GLSL VERSION: 4.10
[17/08/2015 21:27:53] {Debug}        "Version: 4.1"

but no render.

With:

grep 'glFormat.set' Sources/main.cpp
     glFormat.setProfile( QGLFormat::CoreProfile );

I get:

head -n 11 Bin/log.txt [17/08/2015 21:31:14] {Debug}         Starting application:
[17/08/2015 21:31:14] {Debug}        "Running the AwesomeBump 4.0 Beta (2015)"
[17/08/2015 21:31:14] {Debug}        Checking OpenGL version...
[17/08/2015 21:31:14] {Debug}        Widget OpenGL: "3.0"
[17/08/2015 21:31:14] {Debug}        Context valid: true
[17/08/2015 21:31:14] {Debug}        OpenGL information:
[17/08/2015 21:31:14] {Debug}        VENDOR: X.Org
[17/08/2015 21:31:14] {Debug}        RENDERER: Gallium 0.4 on AMD TAHITI (DRM 2.42.0, LLVM 3.8.0)
[17/08/2015 21:31:14] {Debug}        VERSION: 3.0 Mesa 11.0.0-devel (git-5af71fb 2015-08-17 vivid-oibaf-ppa)
[17/08/2015 21:31:14] {Debug}        GLSL VERSION: 1.30
[17/08/2015 21:31:14] {Debug}        "Version: 3.0"

but does not launch.

With:

grep 'glFormat.set' Sources/main.cpp 
    glFormat.setVersion( GL_MAJOR, GL_MINOR );
    glFormat.setProfile(QGLFormat::CompatibilityProfile);

I get:

head -n 11 Bin/log.txt [17/08/2015 21:33:38] {Debug}         Starting application:
[17/08/2015 21:33:38] {Debug}        "Running the AwesomeBump 4.0 Beta (2015)"
[17/08/2015 21:33:38] {Debug}        Checking OpenGL version...
[17/08/2015 21:33:38] {Debug}        Widget OpenGL: "4.1"
[17/08/2015 21:33:38] {Debug}        Context valid: true
[17/08/2015 21:33:38] {Debug}        OpenGL information:
[17/08/2015 21:33:38] {Debug}        VENDOR: X.Org
[17/08/2015 21:33:38] {Debug}        RENDERER: Gallium 0.4 on AMD TAHITI (DRM 2.42.0, LLVM 3.8.0)
[17/08/2015 21:33:38] {Debug}        VERSION: 4.1 (Core Profile) Mesa 11.0.0-devel (git-5af71fb 2015-08-17 vivid-oibaf-ppa)
[17/08/2015 21:33:38] {Debug}        GLSL VERSION: 4.10
[17/08/2015 21:33:38] {Debug}        "Version: 4.1"

it launch but I get no render.

with:

grep 'glFormat.set' Sources/main.cpp
    glFormat.setProfile(QGLFormat::CompatibilityProfile);

I get the same as glFormat.setProfile( QGLFormat::CoreProfile ); only, complains about version, does not launch.

@illwieckz
Copy link
Contributor

I think there is no simple solution for this problem: I tested the "boxes" Qt example and it works on my intel but they use default openGL -- (with Mesa this is openGL 3.0) and they load the necessary extensions manually :/

Is it complicated?

@kmkolasinski
Copy link
Owner

When you start writing your program from scratch it is not so complicated. But now, when the program is already written I don't know even where to start. If you have enough time you can take a look on the "boxes" example how they are loading extensions manually, everything is in the main.cpp file. I will try it later on AB and we will see if this is a good direction.

@illwieckz
Copy link
Contributor

Hmmm, perhaps I'm missing something, but in boxes' main.cpp I only read a check, not a loading (necessaryExtensionsSupported only does comparisons and returns a bool).

@kmkolasinski
Copy link
Owner

Few lines below they initialize necessary extensions: with line

if (!getGLExtensionFunctions().resolve(widget->context())) {
        QMessageBox::critical(0, "OpenGL features missing",
            "Failed to resolve OpenGL functions required to run this demo.\n"
            "The program will now exit.");
        delete widget;
        return -3;
    }

@illwieckz
Copy link
Contributor

Oh yes, in glextensions.cpp.

Do you have an exact list of extensions used?

@kmkolasinski
Copy link
Owner

No... thats the biggest problem:/ With 3.30 and 4.0 I didn't care about the used extensions.
But It can be quickly debugged if you change the following lines:

#ifdef USE_OPENGL_330
    #include <QOpenGLFunctions_3_3_Core>
    #define OPENGL_FUNCTIONS QOpenGLFunctions_3_3_Core
#else
    #include <QOpenGLFunctions_4_0_Core>
    #define OPENGL_FUNCTIONS QOpenGLFunctions_4_0_Core
#endif

to:

#ifdef USE_OPENGL_330
    #include <QOpenGLFunctions_3_0>
    #define OPENGL_FUNCTIONS QOpenGLFunctions_3_0
#else
    #include <QOpenGLFunctions_4_0_Core>
    #define OPENGL_FUNCTIONS QOpenGLFunctions_4_0_Core
#endif

In that file: https://github.com/kmkolasinski/AwesomeBump/blob/master/Sources/glimageeditor.h

Then you will get a bunch of errors during the compilation.

@illwieckz
Copy link
Contributor

Why there is not an #ifdef USE_OPENGL_330 here:
https://github.com/kmkolasinski/AwesomeBump/blob/master/Sources/utils/qglbuffers.h#L38

?

@illwieckz
Copy link
Contributor

And what mean these errors at runtime ?

@kmkolasinski
Copy link
Owner

There is no #ifdef USE_OPENGL_330 because this class does not use functions from the higher version of the openGL 3.30. Are you trying to load extensions manually?

I get same errors when I try to run AB with Mesa which by defaults starts program with GL3.0 context, so for me this is evident that there is a lack of necessary extensions.

@illwieckz
Copy link
Contributor

Are you trying to load extensions manually?

I badly copypasted the glextensions.[cpp|h] file from the qt boxes demo and added every gl reference AwesomeBump complained about, just to try out, but it does not change nothing, but perhaps I'm just doing it wrong.

I have no idea what I am doing

@kmkolasinski
Copy link
Owner

What do you mean by "does not change anything"? a) I does not compile or the errors are same?

@illwieckz
Copy link
Contributor

The errors are the same (i.e. no rendering).

@kmkolasinski
Copy link
Owner

What about the log.txt, same errors?

@illwieckz
Copy link
Contributor

This is the fast & dirty changes I made: master...illwieckz:glloadext

This is the log I get: http://pastebin.com/Wa5B5F2h

@illwieckz
Copy link
Contributor

The things I added to the original demo files are after the // + comment.

@kmkolasinski
Copy link
Owner

Same problems as before, I will take a look on my laptop if I will find more time.

@kmkolasinski
Copy link
Owner

For those how are still interested in this topic: there were some fixes from other contributors, you can try latest source code to check is the error is still present.

@illwieckz
Copy link
Contributor

Oh thanks, I appreciate the cmake build script. 👍

I've just compiled AwesomeBump for GL 3.3 and I get the same issue (i.e. no preview rendering), I've not yet tried the GL 4.0 version of AwesomeBump since I need to install GL 4.0 drivers. I will try it, I'll let you know.

@kmkolasinski
Copy link
Owner

Hi, thank you, but cmake is not a my job :)
Could you also try the clean-legacy branch (this one is not working yet, but we've changed there some deprecated classes, it would be nice to see if this improves something or not).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants