stackgl / headless-gl

🎃 Windowless WebGL for node.js
1.77k stars 170 forks source link

Headless Without binary bindings? #148

Closed adminy closed 5 years ago

adminy commented 5 years ago

Can this run without any bindings or dependencies?

I am trying to run it on an independent platform which has just vanilla js without node or browser sugars.

How tied is this to ANGLE ? I got just a buffer in the graphics card which I could write to, could I use gl features with just that? Thanks.

dhritzkiv commented 5 years ago

headless-gl is very tied to nodejs and Angle as bindings are required to communicate with your gl driver/implementation.

Unfortunately, I can’t think of a way you could use gl with js, that doesn’t involve the node runtime or a browser.

adminy commented 5 years ago

@dhritzkiv I think I found my solution, TinyGL, It converts the webGL buffer to a typed array, which is exactly what I was looking for. I just have to strip canvas context-2d from the project.

adminy commented 5 years ago

@dhritzkiv with this project is it possible to at least make it platform independent so you can manually specify driver in your code instead of the npm module? Like in the fatfs node module example where the block driver is passed to the npm module’s api by the user?

Also instead of a .node file can it be a minified js file?

dhritzkiv commented 5 years ago

@adminy Making this library platform independent is a massive undertaking. It was already difficult to integrate many parts of angle.

Please see this issue: #116 Please also check out Google's node-gles which is more actively developed, but is probably not what you're looking for, either.


It cannot be just a minified js file as bindings to native binaries are required (achieved through .node)