Closed Goury closed 2 years ago
Tried 0.3.0, same result except src/lib.rs:111:13
0.2.0 works fine, but everything is blue T_T
Can you try it with the -vv
option and post the output? Also, what distro are you on?
I too have the same problem on Ubuntu 18.04 with an AMD Radeon RX Vega 64 (open source drivers), here is the verbose output:
$ RUST_BACKTRACE=1 stl-thumb -vv 1_LCD_Base_Left.stl out.png
INFO - STL File: 1_LCD_Base_Left.stl
INFO - Thumbnail File: out.png
INFO - Bounds:
INFO - X: -7, 49.497475
Y: 0, 49.497475
Z: -8, 12
INFO - Center: Point3 [21.248737, 24.748737, 2.0]
INFO - Triangles processed: 1784
INFO - GL Version: Version(Gl, 2, 1)
INFO - GL Version: 2.1 Mesa 18.2.8
INFO - GLSL Version: Version(Gl, 1, 2)
INFO - Vendor: Brian Paul
INFO - Renderer Mesa OffScreen
INFO - Free GPU Mem: None
INFO - Depth Bits: None
ERROR - 0:1(10): error: GLSL 1.20 is not supported. Supported versions are:
thread 'main' panicked at 'Compiling shaders', src/lib.rs:110:13
stack backtrace:
0: <unknown>
1: <unknown>
2: <unknown>
3: <unknown>
4: std::panicking::rust_panic_with_hook
5: <unknown>
6: stl_thumb::run
7: <unknown>
8: <unknown>
9: <unknown>
10: __rust_maybe_catch_panic
11: std::rt::lang_start_internal
12: <unknown>
13: __libc_start_main
14: <unknown>
$
Relevant glxinfo:
$ glxinfo | grep OpenGL | grep -i shading
OpenGL core profile shading language version string: 4.50
OpenGL shading language version string: 4.40
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
$
Ok. I can replicate this in my Ubuntu VM. I will investigate.
Same issue on Ubuntu and also was able to get it compiled and on macOS but it throws this error there as well; I know you don't support macOS but I just wanted to point it out. Here's my Ubuntu (PopOS) out. Also on 2.1 Mesa
and macOS
@unlimitedbacon I have a temp fix that I can confirm works on Ubuntu 18.10. May I create a PR? The line causing the issue is main.rs 16
env::set_var("MESA_GL_VERSION_OVERRIDE", "2.1");
This line is there to work around an issue we were having on Arch with newer versions of Mesa (https://github.com/unlimitedbacon/stl-thumb/issues/8), so removing it would be bad. There are two possible solutions I see.
This is still very weird, though. Since you are getting a similar error on macOS, I wonder if there is some other underlying issue. GLSL 1.20 is the most widely supported version there is, that's why I'm using it. I don't understand why some platforms would claim it's not supported.
It is strange and I don't know enough about Arch to speak intelligently on that. I did however, port the shader / vert to 330 for macOS but only for macOS. It seems to me tehre's something weirder going on the OpenGL side of life here. I can try to investigate more possibly later in the week when I have a chance to get an Arch vm up.
Right now the macOS ports but I am 100% sure it breaks Arch, since it removes that env:set line
Actually, I am using https://github.com/schultyy/os_type to detect for macOS. It says it can detect Arch as well, I wonder if we can just special case Arch in a similar way I am doing mac?
That sounds like a good idea. MacOS support would be very exciting.
I think the problem is not with Arch specifically, but with versions of Mesa >= 18.3.3. It would be interesting to see what happens on Ubuntu with a bleeding edge version of Mesa installed.
I would also be very happy to have someone else look into the OpenGL side of things. This is my first OpenGL project and I'm very confused about this.
Good news. It works fine with Ubuntu 19.04, which uses Mesa 19.0.2.
Just tried new version, it says:
I'm not sure who's fault this is, but just in case: I'm using Nvidia GTX 960 with 390.116 driver on Xorg 1.19.6 I do have some Intel integrated GPU, but it is diabled.