
Show HN: A conformant WebGL implementation for Node.js - 33a
https://github.com/stackgl/headless-gl
======
z3t4
It would be cool if you could talk to the graphics driver and other IO devices
directly from NodeJS. I guess it would require a layer for cross platform
standardization. But would be awesome if you could make a Graphics engine in
NodeJS that just worked everywhere.

I've tried some of the graphics packages for nodeJS but failed at installing
their dependencies. I want something that just works or installable via NPM.

------
bhouston
It is a little buggy for production use at the moment. A bunch of basic things
are broken, but we are working on fixing those issues in the near term:

[https://github.com/stackgl/headless-
gl/issues/62](https://github.com/stackgl/headless-gl/issues/62)

BTW pretty sure OP is mikolalysenko, the author of stackgl. :) Heh, great
work!

~~~
33a
Ok, solved this. The validation for this part of the constant blending was a
bit too strict
[https://www.khronos.org/registry/webgl/specs/1.0/#CONSTANT_C...](https://www.khronos.org/registry/webgl/specs/1.0/#CONSTANT_COLOR_BLEND)
.

Somehow the conformance suite didn't catch this problem (go figure).

------
antihero
Does this mean we can basically render any WebGL code server side and
effectively stream the output?

~~~
33a
You could, but it would be slow, or at least pretty heavy per client. That
said if you have a beefy enough server I suppose it might work.

~~~
nomel
I don't really understand what's going on here.

Is there a practical use for this? When would rendering, server side, ever be
beneficial (assuming that's what's going on here)?

~~~
33a
Lots of places. For example:

* You want to generate preview images of WebGL content, such as in a gallery

* You are using WebGL to accelerate some computation in nodejs with a library like [https://github.com/waylonflinn/weblas](https://github.com/waylonflinn/weblas)

* You want to test your WebGL code using continuous integration

etc.

------
0x0
Funny they mention a project called "node-webgl" being an opengl wrapper.
Seems like they should have traded project names, since "headless-gl" sounds
like an OpenGL thing and "node-webgl" sounds like a WebGL thing, while they're
both the opposite! :)

~~~
33a
Guess which one got there first and took the webgl name on npm? :)

------
AshleysBrain
This looks cool. Are there any demos we could try in our browser?

------
yarp
Is there chance to run threejs on it?

