d3cod3 / Mosaic

Mosaic, an openFrameworks based Visual Patching Creative-Coding Platform
https://mosaic.d3cod3.org
Other
421 stars 23 forks source link

Older GPUs and OpenGL 4.1 #55

Closed Daandelange closed 1 year ago

Daandelange commented 2 years ago

Hey, I use an old IntelHD3000 on my old Linux computer; which supports up to OpenGL 3.3 Mosaic is set to use 4.1 now, which is not natively supported on my GPU. https://github.com/d3cod3/Mosaic/blob/60b4a448b53976e80241bf128aff593af8f032e8/src/main.cpp#L75 It could be nice to support OpenGL3 for older mobos, no ? Is this a question of changing the version number above, or are there other related changes to expect (shaders...) ?

I get this runtime error:

make RunDebug
[ error ] ofAppGLFWWindow: 65543: GLX: Failed to create context: GLXBadFBConfig
[ error ] ofAppGLFWWindow: couldn't create GLFW window

I tried launching Mosaic with software GPU emulation using mesa : (fails compiling the shaders, but launches)

cd ./bin
MESA_GL_VERSION_OVERRIDE=4.1 MESA_GLSL_VERSION_OVERRIDE=150 ./Mosaic 
d3cod3 commented 2 years ago

Well, it would easy to fix, we have that line in the main.cpp and in other 3 files, the ones that creates external windows, OutputWindow.cpp ( windowing/output window ), ProjectionMapping.cpp ( windowing/projection mapping ) and moTimeline.cpp ( gui/timeline ), then if you look at the shaders packed with Mosaic, they are all written in glsl 150, so compatible starting from OpenGL version 3.2

https://github.com/mattdesl/lwjgl-basics/wiki/GLSL-Versions

I think it's an easy issue to fix, just changing the above files to setGLVersion(3,2) should work

Daandelange commented 2 years ago

Ok, I'll make it a #define MO_GL_VERSION_MAJOR & MINOR to make it easier to change on the fly, as custom shaders might need to use more advanced GL versions in some use cases. Defaulted to 3.2 sounds reasonable for supporting older machines (1.3% of the windows game market), even though it concerns the oldest (&cheaper) Intel HD GPUs.
No Rpi support but that might run better with GLES3 shaders anyways.