Edit: Thanks so much for the feedback, I updated my version of Chrome and Kosmos suddenly broke as you described. I debugged it (Chrome once again has changed how it interprets GLSL) and applied a patch. I am also adding an updated compatibility warning message suggesting Firefox, because for whatever reason it performs much more smoothly is less flakey. (Chrome WebGL support is really flakey even on Mac - it literally stopped working for no reason after Chrome auto-updated for me once, then resumed working with another update, and now it was broken again.)
This is actually precisely why I'm abandoning WebGL in favor of Native/OpenGL-ES for future versions of "Kosmos" (I intend to eventually make a game) - WebGL is plagued with compatibility issues, for all but the most traditional/simple GLSL shaders.
Since all the planets in Kosmos are procedurally generated on the GPU, this requires rather complex GLSL shaders (GPU code). Sadly, even with a lot of ugly hacks I've only been able to get this to work on Windows for Firefox, after hacking out a lot of features. It works great on Mac/Linux in my testing though, as long as you have a sufficiently modern GPU that supports modern OpenGL.
The compatibility issues I think are mostly due to ANGLE (http://code.google.com/p/angleproject/), which is Google's so-called "compatibility" layer for WebGL used in both Firefox and Chrome on Windows, apparently. It actually takes your GLSL shader code, and rewrites it as it sees fit. This would be fine if the rewrite didn't break things, but sadly, it breaks things.
But ultimately, the user doesn't care about excuses. The user cares that they see a black screen with no content. Hence, I'm forced to abandon WebGL and go back to native code + OpenGL[ES]. It was a really fun experiment though and I learned a lot in the process.
I saw your post and Reddit and was going to recommend that you post it on HN, but I see that you didn't get much love here!
Anyway, I've always wanted to do something like this but never got around to it. It looks awesome, and I'm definitely going to play around with the code! Great job!
3 comments
[ 2.7 ms ] story [ 16.8 ms ] threadThis is actually precisely why I'm abandoning WebGL in favor of Native/OpenGL-ES for future versions of "Kosmos" (I intend to eventually make a game) - WebGL is plagued with compatibility issues, for all but the most traditional/simple GLSL shaders.
Since all the planets in Kosmos are procedurally generated on the GPU, this requires rather complex GLSL shaders (GPU code). Sadly, even with a lot of ugly hacks I've only been able to get this to work on Windows for Firefox, after hacking out a lot of features. It works great on Mac/Linux in my testing though, as long as you have a sufficiently modern GPU that supports modern OpenGL.
The compatibility issues I think are mostly due to ANGLE (http://code.google.com/p/angleproject/), which is Google's so-called "compatibility" layer for WebGL used in both Firefox and Chrome on Windows, apparently. It actually takes your GLSL shader code, and rewrites it as it sees fit. This would be fine if the rewrite didn't break things, but sadly, it breaks things.
But ultimately, the user doesn't care about excuses. The user cares that they see a black screen with no content. Hence, I'm forced to abandon WebGL and go back to native code + OpenGL[ES]. It was a really fun experiment though and I learned a lot in the process.
Anyway, I've always wanted to do something like this but never got around to it. It looks awesome, and I'm definitely going to play around with the code! Great job!