Mesa compatibility
This MR tries to make Met.3D compatible with more drivers, specifically Mesa. Closes #442
Changes
- GL_ALPHA and GL_ALPHA32F are not part of OpenGL 4.x Core, instead GL_RED and GL_R32F are used now. This also requires shaders to sample the textures from the red channel instead of the alpha channel.
- glLineWidth is deprecated and only supported in some drivers.
- GL_POINT_SMOOTHING is deprecated.
- glPolygonOffset is inconsistent between drivers.
- The dummy textures in shaders were all bound to a single texture unit, meaning only one of the dummy textures was actually bound to all kinds of textures (1D, 2D and 3D), which is not allowed. A texture can only be bound to samplers of the same type.
- A default VAO (vertex array object) is now needed and was added in the scene view.
- glPolygonMode no longer supports GL_FRONT and GL_BACK, only GL_FRONT_AND_BACK. The culling mode replaces that.
- GL_CLAMP is now GL_CLAMP_TO_EDGE
- Smaller issues were also fixed.
What does not work
- Normal curve shader for the raycaster requires an extension in the shader, which GLFX does not parse correctly.
- Odd (uneven) viewport sizes will result in black fragments
To test, you can force the mesa driver with the __GLX_VENDOR_LIBRARY_NAME=mesa
environment variable when starting Met.3D
Edited by Thorwin Vogt