Open yminsky opened 7 years ago
Hello Yaron!
It seems like your system doesn't support GLSL 1.30. I'm a bit boggled as to why... it's been supported on MacOS for several years now. I don't have any Macs for testing, and some Googling hasn't provided any easy answers.
I know Apple has been pushing graphics APIs forward pretty aggressively. It's possible that GLSL 1.30 is too old for this system. I'm using it as a lingua franca, but I might need to reconsider that.
That is odd. These seem vaguely relevant:
http://stackoverflow.com/questions/20264814/glsl-version-130-on-mac-os-x-causes-error http://stackoverflow.com/questions/31803872/opengl-glsl-shaders-on-mac-does-not-compile
but I don't see a clear answer from either one.
That does seem relevant, particularly the bit about Mac OS not supporting GL compatibility profiles. I played with getting Ruckus to request a Core profile explicitly back in December 2015; I believe I ran into a limitation in the Racket GL bindings.
And yet I'm fairly certain that I tested Ruckus on Mac around that time...
Let me see if I can find anyone in the center of the "Racket user - Mac owner - CAD user" Venn diagram nearby.
FWIW I am getting the same error as yminsky. This is on macOS Sierra, the graphics card is a "Intel Iris Graphics 6100 1536 MB".
Without knowing anything about GLSL, I have attempted the following:
These changes are enough to remove errors from GL.
Alas, now I get an error from Racket:
link: bad variable linkage;
reference to a variable that is not a procedure or structure-type constant across all instantiations
reference phase level: 0
variable module: "
/Users/soegaard/Dropbox/GitHub/racket/racket/share/pkgs/ruckus/viz/glsl.rkt"
variable phase: 0
reference in module:
"/Users/soegaard/Dropbox/GitHub/racket/racket/share/pkgs/ruckus/viz/spheretrace-viewer.rkt"
in: node->glsl-distance
I'd love to try out Ruckus, but I'm running into the same problem.
It's probably going to get worse -- my understanding is that Apple has deprecated OpenGL support, with the intent of removing it soon. As I cannot program against their proprietary alternative (because I don't have a Mac), Ruckus (and all Racket GL programs) will stop working completely.
Given this, it might not be worth debugging. :-(
Thanks for the update, I'll try it out in Linux.
@soegaard got most of the needed changes but not all of them.
I forked this repo to zen3d/ruckus, and it now runs on MacOS.
Primary changes: 1) replace all "uint" to "int", 2) remove "u" from uint literals, 3) don't append "u" to number code generation, 4) change GLSL version to 120, 5) eliminate references to "out vec4 fragColor;", 6) change "fragColor" assignments to "gl_FragColor", and 7) replace "nid % 512" with an equivalent expression that works in GLSL 1.2.
That said, I haven't tested these changes on any other machines or other OS variants.
If @cbiffle wants a diff to incorporate the changes, I will gladly provide them. But if not, I will proceed to make further enhancements to my fork. The implication of this change is that more machines will run ruckus at the cost of potentially some performance impact on higher end systems. How much impact is TBD.
My objective is to get feature parity with OpenScad, and the current state of ruckus is mostly there except for polygons and polyhedra (that is probably an over-simplification, but it's good enough for me).
I just verified that my changes also work on linux (specifically, Linux Mint Debian Edition, although that shouldn't matter) with an NVidia GTX 1080 driven by NVidia's closed source proprietary drivers. It is a bit faster on some of the slower demos, but most demos run as fast as my MacBook Pro with an NVidia GT 750M GPU. Not that most of the demos push the performance envelop.
On the other hand, they don't work remotely via vanilla VNC or RDP, but then again, 3D via remote access is generally broken regardless of platform, at least with those two protocols. There are ways around that limitation, but you have to jump through a bunch of hoops. So no surprises there.
As always, YMMV.
PS The failure mode for remote access is that racket doesn't find a new enough version of glx, FWIW. I'm guessing this might have something to do with the way linux emulates a GPU in software when it provides remote access, but that's just a guess.
@zen3d Thanks! I can confirm that the changes work on macOS.
@soegaard Thanks for that confirmation, Jens.
I tried the most basic example (making just a sphere), and it failed with the following output: