Live data from Hacker News

SwissGL: Swiss Army Knife for WebGL2

github.com

11–19 of 19 posts

Re: SwissGL: Swiss Army Knife for WebGL2

#11
post #7

Author here. SwissGL is an experiment in minimal API design. I needed something that would simplify making things like https://znah.net/hexells or https://znah.net/lenia I'm planning to switch to WebGPU once it's widely supported. I also think there's a chance for SwissGL.c, SwissGL.py and SwissGL.zig

The example in the README seems to be dividing “undefined” by 1000. Am I misunderstanding something, does that code truly generate the output shown somehow?

Re: SwissGL: Swiss Army Knife for WebGL2

#12
post #11
post #7

Author here. SwissGL is an experiment in minimal API design. I needed something that would simplify making things like https://znah.net/hexells or https://znah.net/lenia I'm planning to switch to WebGPU once it's widely supported. I also think there's a chance for SwissGL.c, SwissGL.py and SwissGL.zig

The example in the README seems to be dividing “undefined” by 1000. Am I misunderstanding something, does that code truly generate the output shown somehow?

Fixed, thanks for pointing! Undefined is only passed at the first frame, other frames receive current time in ms, according to requestAnimationFrame docs

Re: SwissGL: Swiss Army Knife for WebGL2

#13
post #5

Earlier quoted context omitted.

The biggest difference I spot between the two is that WebGL2 uses OpenGL ES 3 and WebGL uses OpenGL ES 2, but really other than supporting by default things that required extensions in WebGL I don't see much of an improvement. Also, it was released in Firefox in 2017 meaning it has been here for a long time already [0]. Interestingly enough projects such as Godot seem to until recently give preference to other APIs s…

It was also supposed to support GL ES compute shaders, developed by Intel, which Google refused to implement in name of WebGPU compute. So here we are without WebGPU being stable and without WebGL compute.

Apple refused to implement GL compute shaders. Without that, Intel's code didn't work on macOS.

Re: SwissGL: Swiss Army Knife for WebGL2

#14
post #5

Earlier quoted context omitted.

It was also supposed to support GL ES compute shaders, developed by Intel, which Google refused to implement in name of WebGPU compute. So here we are without WebGPU being stable and without WebGL compute.

Apple refused to implement GL compute shaders. Without that, Intel's code didn't work on macOS.

It isn't as if WebGL relies on GL on Windows.

Chrome could have done it on top of Metal.

Re: SwissGL: Swiss Army Knife for WebGL2

#15
post #14

Earlier quoted context omitted.

Apple refused to implement GL compute shaders. Without that, Intel's code didn't work on macOS.

It isn't as if WebGL relies on GL on Windows. Chrome could have done it on top of Metal.

Yes, Chrome could have rewritten the entire WebGL implementation to run on Metal. Maybe. Without support from Apple I'm not certain that WebGL 2 could have been fully implemented in a 100% compatible way over desktop Metal at the time. But it's not as though Google rejected a working implementation for no good reason.

Re: SwissGL: Swiss Army Knife for WebGL2

#16
post #14

Earlier quoted context omitted.

It isn't as if WebGL relies on GL on Windows. Chrome could have done it on top of Metal.

Yes, Chrome could have rewritten the entire WebGL implementation to run on Metal. Maybe. Without support from Apple I'm not certain that WebGL 2 could have been fully implemented in a 100% compatible way over desktop Metal at the time. But it's not as though Google rejected a working implementation for no good reason.

And now WebGL 2.0 on Safari is actually implemented on top of Metal, with help of Chrome team.

"At the time" was 2021.

Politics.

Re: SwissGL: Swiss Army Knife for WebGL2

#17
post #16

Earlier quoted context omitted.

Yes, Chrome could have rewritten the entire WebGL implementation to run on Metal. Maybe. Without support from Apple I'm not certain that WebGL 2 could have been fully implemented in a 100% compatible way over desktop Metal at the time. But it's not as though Google rejected a working implementation for no good reason.

And now WebGL 2.0 on Safari is actually implemented on top of Metal, with help of Chrome team. "At the time" was 2021. Politics.

"At the time" was 2019 actually. Back then it wasn't even clear if Apple would ever implement WebGL 2 at all.

Re: SwissGL: Swiss Army Knife for WebGL2

#18
post #16

Earlier quoted context omitted.

And now WebGL 2.0 on Safari is actually implemented on top of Metal, with help of Chrome team. "At the time" was 2021. Politics.

"At the time" was 2019 actually. Back then it wasn't even clear if Apple would ever implement WebGL 2 at all.

https://bugs.chromium.org/p/chromium/issues/detail?id=113199...

-- Sep 24, 2020,

https://registry.khronos.org/webgl/specs/latest/2.0-compute/

-- Last update, regarding deprecation, 31 March 2021

Hence 2021.

Same reasoning could be applied to Microsoft and Sony Playstation browsers, where neither of them support GL.

Fact is that after all these years, WebGPU still isn't here as stable version that one can rely on, and even then it is only a MVP with an incompatible shader language.

Re: SwissGL: Swiss Army Knife for WebGL2

#19
post #18

Earlier quoted context omitted.

"At the time" was 2019 actually. Back then it wasn't even clear if Apple would ever implement WebGL 2 at all.

https://bugs.chromium.org/p/chromium/issues/detail?id=113199... -- Sep 24, 2020, https://registry.khronos.org/webgl/specs/latest/2.0-compute/ -- Last update, regarding deprecation, 31 March 2021 Hence 2021. Same reasoning could be applied to Microsoft and Sony Playstation browsers, where neither of them support GL. Fact is that after all these years, WebGPU still isn't here as stable version that one can rely on, and…

The code wasn't removed immediately when the decision was made so that people could continue prototyping compute shaders before WebGPU was available to test on. Game console browsers are completely irrelevant as their market share is so miniscule it's not even visible on most tracking sites.
Post reply on HN